40 lines
1.2 KiB
Plaintext
40 lines
1.2 KiB
Plaintext
Type TSDocxTablesOfContents = Class(TSVbaBase)
|
|
|
|
public
|
|
Function Init(docx);
|
|
|
|
public
|
|
// Methods
|
|
Function Add(Range, UseHeadingStyles, UpperHeadingLevel, LowerHeadingLevel, UseFields, TableID, RightAlignPageNumbers, IncludePageNumbers, AddedStyles, UseHyperlinks, HidePageNumbersInWeb, UseOutlineLevels);
|
|
Function Item(Index);
|
|
Function MarkEntry(Range, Entry, EntryAutoText, TableID, Level);
|
|
|
|
// Properties
|
|
property Count read ReadCount;
|
|
property Format read ReadFormat write WriteFormat;
|
|
Function WriteFormat(value);
|
|
Function ReadFormat();
|
|
Function ReadCount();
|
|
|
|
private
|
|
docx_;
|
|
|
|
End;
|
|
|
|
// ============== 实现 ================= //
|
|
Function TSDocxTablesOfContents.Init(docx);
|
|
Begin
|
|
docx_ := docx;
|
|
End;
|
|
|
|
|
|
// Methods
|
|
Function TSDocxTablesOfContents.Add(Range, UseHeadingStyles, UpperHeadingLevel, LowerHeadingLevel, UseFields, TableID, RightAlignPageNumbers, IncludePageNumbers, AddedStyles, UseHyperlinks, HidePageNumbersInWeb, UseOutlineLevels);
|
|
Begin
|
|
paragraph := Range.InsertPara();
|
|
if ifnil(UpperHeadingLevel) then UpperHeadingLevel := 1;
|
|
if ifnil(LowerHeadingLevel) then LowerHeadingLevel := 9;
|
|
docx_.AddTableContent(paragraph.Object(), UpperHeadingLevel, LowerHeadingLevel);
|
|
paragraph.Range.Clear(True);
|
|
End;
|