Difference between revisions of "AODL example 15"
From Apache OpenOffice Wiki
| Line 17: | Line 17: | ||
</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:17, 25 June 2007
Create a standard Paragraph with formated text
//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 formated text
FormatedText formText = new FormatedText(document, "T1", "Some formated text!");
formText.TextStyle.TextProperties.Bold = "bold";
paragraph.TextContent.Add(formText);
//Add the paragraph to the document
document.Content.Add(paragraph);
//Save
document.SaveTo("formated.odt");
Back to the AODL examples overview.