lemonhalls
Technical User
Hi all,
I'm a newbie at programming and am not sure how to change the spacing within my TOC to 1.5 pt.
I have this code that changes only the first 4 paragraphs
Set myRange = ActiveDocument.Range( _
Start:=ActiveDocument.Paragraphs(1).Range.Start, _
End:=ActiveDocument.Paragraphs(4).Range.End)
myRange.paragraphFormat.LineSpacingRule = wdLineSpace1pt5
but because my TOC is dependant on the content of the document, I do not know how many paragraphs nor pages the TOC will be.
Currently, the TOC starts at the second page. It is a one pager, but it may grow to be a two pager. This is my code for the TOC
With ActiveDocument
.TablesOfContents.Add Range:=Selection.Range, RightAlignPageNumbers:= _
True, UseHeadingStyles:=True, UpperHeadingLevel:=3, LowerHeadingLevel:=3, _
IncludePageNumbers:=True, AddedStyles:="Heading 3", _
UseHyperlinks:=True, HidePageNumbersInWeb:= _
True, UseOutlineLevels:=False
.TablesOfContents(1).TabLeader = wdTabLeaderDots
.TablesOfContents.Format = wdIndexIndent
End With
What should I select in the paragraphFormat statement to ensure the content within the TOC is spaced at 1.5 pt? Is it the active page?? number of lines in the TOC?? Or can I incorporate it within the TOC code?
Many thanks,
S
I'm a newbie at programming and am not sure how to change the spacing within my TOC to 1.5 pt.
I have this code that changes only the first 4 paragraphs
Set myRange = ActiveDocument.Range( _
Start:=ActiveDocument.Paragraphs(1).Range.Start, _
End:=ActiveDocument.Paragraphs(4).Range.End)
myRange.paragraphFormat.LineSpacingRule = wdLineSpace1pt5
but because my TOC is dependant on the content of the document, I do not know how many paragraphs nor pages the TOC will be.
Currently, the TOC starts at the second page. It is a one pager, but it may grow to be a two pager. This is my code for the TOC
With ActiveDocument
.TablesOfContents.Add Range:=Selection.Range, RightAlignPageNumbers:= _
True, UseHeadingStyles:=True, UpperHeadingLevel:=3, LowerHeadingLevel:=3, _
IncludePageNumbers:=True, AddedStyles:="Heading 3", _
UseHyperlinks:=True, HidePageNumbersInWeb:= _
True, UseOutlineLevels:=False
.TablesOfContents(1).TabLeader = wdTabLeaderDots
.TablesOfContents.Format = wdIndexIndent
End With
What should I select in the paragraphFormat statement to ensure the content within the TOC is spaced at 1.5 pt? Is it the active page?? number of lines in the TOC?? Or can I incorporate it within the TOC code?
Many thanks,
S