![](/img/trans.png)
[英]how to add caption bottom or above of picture in Aspose.Word for C# .Net
[英]how to insert caption to table and figure in aspose.word
我想創建一個圖形表和一個表表,但是第一個表和圖應該有標題才能識別。我需要在表和圖上插入標題
請嘗試使用以下代碼。
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一起擔任開發人員推廣人員。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.