Difference between revisions of "AODL example 14"
From Apache OpenOffice Wiki
| Line 23: | Line 23: | ||
</pre> | </pre> | ||
Back to the [[AODL_examples|AODL examples]] overview. | Back to the [[AODL_examples|AODL examples]] overview. | ||
| + | [[category:Summer of Code 2007]][[category:AODL]] | ||
Revision as of 22:16, 25 June 2007
Create a List with List Item objects
//Create a new text document
TextDocument document = new TextDocument();
document.New();
//Create a numbered list
List li = new List(document, "L1", ListStyles.Bullet, "L1P1");
//Create a new list item
ListItem lit = new ListItem(li);
//Create a paragraph
Paragraph paragraph = ParagraphBuilder.CreateStandardTextParagraph(document);
//Add some text
paragraph.TextContent.Add(new SimpleText(document, "First item"));
//Add paragraph to the list item
lit.Content.Add(paragraph);
//Add the list item
li.Content.Add(lit);
//Add the list
document.Content.Add(li);
//Save document
document.SaveTo("list.odt");
Back to the AODL examples overview.