I would like to insert the caption Table above- and below the picture In an existing Word document- how to do it.Similar attachments

  1. I would like to insert the caption Table above, and below the picture In an existing Word document, how to do it.Similar attachments

  2. I want get the multilevel list in front of the paragraph in a Word document(That is:Get 1,2 in front test), for example?

  3. Similar functions in the word(ListFormat.ConvertNumbersToText()), which replaced in words?

Hi,

Thanks for your inquiry and sorry for the delayed response.

  1. I have attached a sample document here with this post; please run the following code to generate the expected captions:
Document doc = new Document(@"C:\Temp\SetCaptions.doc");
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(@"C:\Temp\out.doc");
  1. The lists that you create with Aspose.Words are always multi-level lists and contain 9 levels. Please use List.IsMultiLevel Property; it returns true when the list contains 9 levels and false when there is only 1 level.

  2. I have attached a sample document (List.docx); please run the following code to produce the target output:

Document doc = new Document(@"C:\Temp\List.docx");
ListLevel level1 = doc.Lists[0].ListLevels[0];
level1.Font.Color = Color.Red;
level1.Font.Size = 24;
level1.NumberStyle = NumberStyle.OrdinalText;
level1.StartAt = 1;
doc.Save(@"C:\Temp\out.docx");

I hope, this will help.

Best Regards,