Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-04-2018, 08:14 AM
wolfer wolfer is offline Section Break (Continuous) counted as Section Break (Next page) Windows 7 64bit Section Break (Continuous) counted as Section Break (Next page) Office 2003
Novice
Section Break (Continuous) counted as Section Break (Next page)
 
Join Date: Aug 2011
Posts: 3
wolfer is on a distinguished road
Default Section Break (Continuous) counted as Section Break (Next page)

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
Reply With Quote
  #2  
Old 01-06-2018, 03:52 AM
Guessed's Avatar
Guessed Guessed is offline Section Break (Continuous) counted as Section Break (Next page) Windows 10 Section Break (Continuous) counted as Section Break (Next page) Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,967
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
Reply With Quote
  #3  
Old 01-06-2018, 09:51 AM
wolfer wolfer is offline Section Break (Continuous) counted as Section Break (Next page) Windows 7 64bit Section Break (Continuous) counted as Section Break (Next page) Office 2003
Novice
Section Break (Continuous) counted as Section Break (Next page)
 
Join Date: Aug 2011
Posts: 3
wolfer is on a distinguished road
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Section Break (Continuous) counted as Section Break (Next page) Word converts section break to page break before columns, does not insert column breaks eborda Word 1 03-24-2017 11:06 PM
Section Break (Continuous) counted as Section Break (Next page) Section - Page Break changes to Section - continuous? donaldadams1951 Word VBA 13 03-27-2014 07:03 PM
Section Break (Continuous) counted as Section Break (Next page) Section Break (Next Page) replaces Section Break (Continuous) when deleted 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
Section Break (Continuous) counted as Section Break (Next page) Section Break Continuous: doesn't affect the format of the page numbering Jamal NUMAN Word 2 06-22-2011 04:46 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:48 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft