J
JMS
Please can somebody help me... I am trying to create a Table of Contents to
include specific styles, however when I run the code it includes Heading
Styles 1 - 3 as well as the specified styles. I am using the following
command:
With ActiveDocument
.TablesOfContents.Add Range:=Selection.Range, RightAlignPageNumbers:= _
True, UseHeadingStyles:=False, IncludePageNumbers:=True, AddedStyles _
:= _
"Sch main head,1,Sch part head,2,Sch (1style) clause,3,Sch main
head single,1" _
, UseHyperlinks:=True, HidePageNumbersInWeb:=True, UseOutlineLevels _
:=True
.TablesOfContents(1).TabLeader = wdTabLeaderDots
.TablesOfContents.Format = wdIndexIndent
End With
I would like to get to a result where:
"Sch main head" Uses TOC Level 1
"Sch main head single" Uses TOC Level 1
"Sch part head" Uses TOC Level 2
"Sch (1style) clause" Uses TOC Level 3
The code has set UseHeadingStyles:=False but it seems to be ignoring it.
Can anybody help me.
Many thanks
Jon
include specific styles, however when I run the code it includes Heading
Styles 1 - 3 as well as the specified styles. I am using the following
command:
With ActiveDocument
.TablesOfContents.Add Range:=Selection.Range, RightAlignPageNumbers:= _
True, UseHeadingStyles:=False, IncludePageNumbers:=True, AddedStyles _
:= _
"Sch main head,1,Sch part head,2,Sch (1style) clause,3,Sch main
head single,1" _
, UseHyperlinks:=True, HidePageNumbersInWeb:=True, UseOutlineLevels _
:=True
.TablesOfContents(1).TabLeader = wdTabLeaderDots
.TablesOfContents.Format = wdIndexIndent
End With
I would like to get to a result where:
"Sch main head" Uses TOC Level 1
"Sch main head single" Uses TOC Level 1
"Sch part head" Uses TOC Level 2
"Sch (1style) clause" Uses TOC Level 3
The code has set UseHeadingStyles:=False but it seems to be ignoring it.
Can anybody help me.
Many thanks
Jon