W
wd2306
Unregistered / Unconfirmed
GUEST, unregistred user!
这是我录制的宏用来更新目录的
With ActiveDocument
.TablesOfContents(1).Delete
.TablesOfContents.Add Range:=Selection.Range, RightAlignPageNumbers:= _
True, UseHeadingStyles:=True, UpperHeadingLevel:=1, _
LowerHeadingLevel:=3, IncludePageNumbers:=True, AddedStyles:=""
.TablesOfContents(1).TabLeader = wdTabLeaderDots
End With
我把它改写成delphi代码
AppWord.Activedocument.TablesOfContents.Delete;
AppWord.Activedocument.TablesOfContents.RightAlignPageNumbers:=True;
AppWord.Activedocument.TablesOfContents.UseHeadingStyles:=True;
AppWord.Activedocument.TablesOfContents.UpperHeadingLevel:=1;
AppWord.Activedocument.TablesOfContents.LowerHeadingLevel:=3;
AppWord.Activedocument.TablesOfContents.IncludePageNumbers:=True;
AppWord.Activedocument.TablesOfContents(1).TabLeader := wdTabLeaderDots;
AppWord.Activedocument.TablesOfContents.format:=wdIndexIndent;
结果它说我没有这个TablesOfContents方法,怎么回事难道我写错了
同志们,调试好了再告诉我正确的。