AODL example 16

From Apache OpenOffice Wiki
Revision as of 20:33, 4 March 2007 by LarsBehr (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Create a simple Paragraph using the ParagraphBuilder

//Create a new text document
TextDocument document = new TextDocument();
document.New();
//Create a standard paragraph using the ParagraphBuilder
Paragraph paragraph = ParagraphBuilder.CreateStandardTextParagraph(document);
//Add some simple text
paragraph.TextContent.Add(new SimpleText(document, "Some simple text!"));
//Add the paragraph to the document
document.Content.Add(paragraph);
//Save 
document.SaveTo("simple.odt");

Back to the AODL examples overview.

Personal tools