【发布时间】:2017-11-21 11:03:28
【问题描述】:
我想创建一个图表和表格的表格,但第一个表格和图表应该有标题是识别。我需要在表格和图表中插入标题
【问题讨论】:
标签: c# .net aspose caption aspose.words
我想创建一个图表和表格的表格,但第一个表格和图表应该有标题是识别。我需要在表格和图表中插入标题
【问题讨论】:
标签: c# .net aspose caption aspose.words
请尝试使用以下代码。
Document doc = new Document(MyDir + "in.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
// Insert caption above the Table
builder.MoveTo(doc.FirstSection.Body.Tables[0].PreviousSibling);
builder.Write("Table: ");
builder.InsertField(@"SEQ Table \* ARABIC", "");
// Insert caption below the Figure
builder.MoveToDocumentEnd();
builder.InsertParagraph();
builder.Write("Figure: ");
builder.InsertField(@"SEQ Figure \* ARABIC", "");
doc.UpdateFields();
doc.Save(MyDir + @"17.11.docx");
我与 Aspose 合作,担任开发人员宣传员。
【讨论】: