strAddedStyles = "Heading 1,1"
WdDoc.TablesOfContents.add(Range:=WdDoc.bookmarks.Item("\endofdoc").Range, _
UseHeadingStyles:=True, UpperHeadingLevel:=1, _
LowerHeadingLevel:=3, AddedStyles:=strAddedStyles, UseHyperlinks:=True)
CurrentScenario.jpgAre you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
Open in new window
The VB6 code and the VBA code are virtually identical.