View Single Post
 
Old 09-16-2019, 11:14 AM
Porteņo Porteņo is offline Windows 10 Office 2016
Novice
 
Join Date: Sep 2019
Posts: 2
Porteņo is on a distinguished road
Default looping thru heading2 sections and relocate them

Hi, it has been ages since the last time I coded VBA, but alway Excel and some Access.

Now is time on Word. I'm glad I found you!

Sections of my document fall under the heading style of heading 2. The section headings will be labeled for instance:

Section Heading 1
Section Heading 2
Section Heading 3
Section Heading 4
Section Heading 5

Some or all of these headings may exist in a document and they may not appear in the order listed above.

on running the macro I would like the sections in the document to be ordered so that they match the list above.


I'm just starting with this code, but I can't understand what I'm seeing watching Sec.

Code:
Dim Sec As Section
    For Each Sec In ActiveDocument.Sections
       
    Next Sec
Would you point me out some reference to the object model fast track tutorial?
Reply With Quote