View Single Post
 
Old 07-19-2019, 06:57 AM
mattbrad mattbrad is offline Mac OS X Office 2019
Novice
 
Join Date: Jul 2019
Posts: 2
mattbrad is on a distinguished road
Default Macro to wrap each section in a document with some text

I am trying to create a macro that runs through a document section by section and then inserts some text at the start and end of the section.

e.g. Before

Heading 1
Some text here
Heading 2
Some text here
SubHeading2.1
Table here
Sub Heading 2.2
Table Here
Some Text Here

After
Heading 1
STARTSome text hereEND
Heading 2
STARTSome text hereEND
SubHeading2.1
STARTTable hereEND
Sub Heading 2.2
STARTTable Here
Some Text HereEND

When I run ActiveDocuments.Sections.Count, it returns 1 so I can seem to loop over it?

Is this something to do with the way the sections have been added?
Reply With Quote