Determine if previous "character" is a section break

Joined
Sep 16, 2016
Messages
4
Reaction score
0
I have written a function in a macro that will add an intentional blank page when it encounters a certain tag (which is inserted from DOORS script) and it is on an even-numbered page. There are cases, however, when a Section Break is not needed such as when it changes from a portrait layout to landscape or vice versa. Is there a way in VBA to determine if the previous "character" is a section break?

Chris
 

macropod

Microsoft MVP
Joined
Mar 2, 2012
Messages
580
Reaction score
50
The simplest approach is to test whether that character is ASCII 12 - Chr(12).
 

macropod

Microsoft MVP
Joined
Mar 2, 2012
Messages
580
Reaction score
50
Chr(12) applies to Section breaks and manual page breaks alike. More sophisticated methods are available to differentiate the various type of Section break from each other and from manual page breaks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top