I want to creat a numbered list which contains a line of text without a number in front. This line has to be intended. I attatched a picture showing what I mean.
I’m not able to creat a document which looks like that using Aspose.Words. In Microsoft Word I just start a new numbered list, write my text and press Shift+Enter. Then I can enter the text as I want.
Hello
Thanks for your request. Please try using the following code:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Create list.
List list = doc.getLists().add(ListTemplate.NUMBER_DEFAULT);
// Assign list to the first paragraph.
builder.getCurrentParagraph().getListFormat().setList(list);
builder.write("First Element");
builder.insertBreak(BreakType.LINE_BREAK);
builder.writeln("After First");
// Insert the second item.
builder.write("Second Element");
doc.save("C:\\Temp\\out.doc");