wdActiveEndSectionNumber

Joined
May 13, 2016
Messages
1
Reaction score
0
OK, I just figured out that this returns the document section numbers and it is correct. Is there a wd statement that returns the heading number (e.g., Section 2.1.4)?

I need help with the following vb. This is part of a macro used to take a section number from a Word 2010 doc and populate an Excel spreadsheet. When I run this, the resulting numbers do not match the actual section numbers.

For n = 1 To nCount
'comment number
.Cells(n + HeadingRow, 1).Value = n
'call function to get section heading
.Cells(n + HeadingRow, 2).Value = oDoc.Comments(n).Range.Information(wdActiveEndSectionNumber)
 
Last edited:

macropod

Microsoft MVP
Joined
Mar 2, 2012
Messages
578
Reaction score
50
The following Word macro returns the correct Section #s for comments in my testing:

Sub Demo()
Dim i As Long
With ActiveDocument
For i = 1 To .Comments.Count
MsgBox .Comments(i).Range.Information(wdActiveEndSectionNumber)
Next
End With
End Sub
 

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