Difference between revisions of "AODL example 12"
From Apache OpenOffice Wiki
| Line 20: | Line 20: | ||
</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:15, 25 June 2007
Create any type of hyperlinks by using the XLink class
//Create new TextDocument
TextDocument document = new TextDocument();
document.New();
//Create a new Paragraph
Paragraph para = new Paragraph(document, "P1");
//Create some simple text
SimpleText stext = new SimpleText(document, "Some simple text ");
//Create a XLink
XLink xlink = new XLink(document, "http://www.OpenOffice.org", "OpenOffice.org");
//Add the textcontent
para.TextContent.Add(stext);
para.TextContent.Add(xlink);
//Add paragraph to the document content
document.Content.Add(para);
//Save
document.SaveTo("XLink.odt");
Back to the AODL examples overview.