nese; CalendarType := wdCalendarWestern; FWord.Selection.InsertDateTime(DateTimeFormat, InsertAsField, InsertAsFullWidth, DateLanguage, CalendarType); except insertDate(); end; end; //插入页码 procedure TMyWord.insertPagenum(); var PSection: Section; PageNumberAlignment: olevariant; FirstPage: olevariant; begin PSection := FWord.Selection.Sections.Item(1); PageNumberAlignment := 1; //中间 FirstPage := True; PSection.Footers.Item(wdHeaderFooterPrimary).PageNumbers.Add(PageNumberAlignment, FirstPage); end; //设置表格一列高度 procedure TMyWord.SetTableheight(PTable: Table; RowIdx: Integer; height: Integer); var Prow: Row; begin Prow := PTable.Rows.Item(RowIdx); Prow.SetHeight(height, wdAdjustNone); end; //设置表格一列宽度 procedure TMyWord.SetTable(PTable: Table; ColumnIdx: Integer; Width: Integer); begin PTable.Columns.Item(ColumnIdx).SetWidth(Width, wdAdjustNone); end; //插入目录 procedure TMyWord.InsertContents(); var pRange: Range; UseHeadingStyles: olevariant; UpperHeadingLevel: olevariant; LowerHeadingLevel: olevariant; UseFields: olevariant; TableID: olevariant; RightAlignPageNumbers: olevariant; IncludePageNumbers: olevariant; AddedStyles: olevariant; UseHyperlinks: olevariant; HidePageNumbersInWeb: olevariant; begin with FWord.ActiveDocument do begin pRange := FWord.Selection.Range; RightAlignPageNumbers := True; UseHeadingStyles := True; UpperHeadingLevel := 1; LowerHeadingLevel := 3; IncludePageNumbers := True; UseHyperlinks := True; HidePageNumbersInWeb := True; TablesOfContents.Add(pRange, UseHeadingStyles, UpperHeadingLevel, LowerHeadingLevel, UseFields, TableID, RightAlignPageNumbers, IncludePageNumbers, AddedStyles, UseHyperlinks, HidePageNumbersInWeb); &nbs