![]() |
#1
|
|||
|
|||
![]()
I have a word document consisting of sections: continuous or next page. I want to print a selected section or sections (next page) from an Excel sheet. I use the following statement to identify a section break (next page) from a section break (continuous)
objDoc.Sections(j + mm).PageSetup.SectionStart = WdSectionStart.wdSectionNewPage Most of the time, this works; however, in one case, a section break (continuous) was taken as a section break (next page). Can any one, please, give any hint? Thanks |
#2
|
||||
|
||||
![]()
Wolfer
That code doesn't identify anything. It sets a section start to New Page but doesn't ask what it was before the code ran. It is also flawed as written and I'm surprised it actually works. If you wanted to change the section break type then it should be: objDoc.Sections(j + mm).PageSetup.SectionStart = wdSectionNewPage If you want to find out what type of section break it is then you could use Code:
Select Case ActiveDocument.Sections(2).PageSetup.SectionStart Case wdSectionNewPage 'do something Case wdSectionContinuous 'do something else Case Else 'do another thing End Select
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
![]()
Hi Andrew,
Thanks for your reply. Yes, you're right. The code I displayed above is not the complete one. I have found out the problem; I used a wrong parameter: I should have used "i+mm" instead of "j+mm". So the problem is not section break (next page) vs. a section break (continuous). Again, thanks. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
eborda | Word | 1 | 03-24-2017 11:06 PM |
![]() |
donaldadams1951 | Word VBA | 13 | 03-27-2014 07:03 PM |
![]() |
Carlabasson | Word | 2 | 03-25-2013 10:13 PM |
why the "section break-next page" is switched to "section break-continuous"? | Jamal NUMAN | Word | 6 | 12-14-2011 03:35 PM |
![]() |
Jamal NUMAN | Word | 2 | 06-22-2011 04:46 PM |