Difference between revisions of "AODL example 16"

From Apache OpenOffice Wiki
Jump to: navigation, search
m
 
Line 1: Line 1:
 
<b>Create a simple Paragraph using the ParagraphBuilder</b>
 
<b>Create a simple Paragraph using the ParagraphBuilder</b>
  
<pre>
+
<syntaxhighlight lang="c">
 
//Create a new text document
 
//Create a new text document
 
TextDocument document = new TextDocument();
 
TextDocument document = new TextDocument();
Line 13: Line 13:
 
//Save  
 
//Save  
 
document.SaveTo("simple.odt");
 
document.SaveTo("simple.odt");
</pre>
+
</syntaxhighlight>
 
Back to the [[AODL_examples|AODL examples]] overview.
 
Back to the [[AODL_examples|AODL examples]] overview.
 
[[category:Summer of Code 2007]][[category:AODL]]
 
[[category:Summer of Code 2007]][[category:AODL]]

Latest revision as of 12:45, 22 May 2022

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