View Single Post
 
Old 01-06-2018, 03:52 AM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
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