Type TSDocxTables = Class(TSVbaBase) public Function Init(docx); Function Operator[](index); private docx_; public Function Add(Range, NumRows, NumColumns, DefaultTableBehavior, AutoFitBehavior); Function Item(Index); property Count read ReadCount; property NestingLevel read ReadNestingLevel; Function ReadNestingLevel(); Function ReadCount(); End; // ============== 实现 ================= // Function TSDocxTables.Init(docx); Begin docx_ := docx; End; Function Operator TSDocxTables.[](index); Begin table := docx_.GetTable(index - 1); table_obj := new TSDocxTable(self.Application, self.Creator, self); table_obj.Init(docx_, table); return table_obj; End; // function Function TSDocxTables.Item(Index); Begin return self[Index]; End; // property Function TSDocxTables.ReadCount(); Begin return docx_.TablesCount(); End;