Hello,
Thanks for your inquiry.
Our Spire.DocViewer product just supports viewing Word document, not support manipulating Word document. Do you want to use our Spire.Doc to manipulate Word document? If so, please refer to the following code.
- Code: Select all
//Create word document
Document document = new Document();
Section section = document.AddSection();
//Create a list style
ListStyle listStyle = new ListStyle(document, ListType.Numbered);
listStyle.Name = "levelstyle";
listStyle.Levels[0].PatternType = ListPatternType.Arabic;
listStyle.Levels[0].NumberPosition = -28.3f;
listStyle.Levels[0].TabSpaceAfter = 0;
listStyle.Levels[0].TextPosition = 28.3f;
document.ListStyles.Add(listStyle);
//Add the first paragarph
Paragraph paragraph = section.AddParagraph();
TextRange tr = paragraph.AppendText("Paragraph 1");
paragraph.ListFormat.ApplyStyle("levelstyle");
//Add the second paragarph
paragraph = section.AddParagraph();
tr = paragraph.AppendText("Paragraph 2");
paragraph.ListFormat.ApplyStyle("levelstyle");
document.SaveToFile("result.docx");
If this is not what you want, please provide your desired output for further investigation.
Sincerely,
Rachel
E-iceblue support team