Difference between revisions of "AODL example 12"

From Apache OpenOffice Wiki
Jump to: navigation, search
 
m
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 
<b>Create any type of hyperlinks by using the XLink class</b>
 
<b>Create any type of hyperlinks by using the XLink class</b>
  
<pre>
+
<syntaxhighlight lang="c">
 
//Create new TextDocument
 
//Create new TextDocument
 
TextDocument document = new TextDocument();
 
TextDocument document = new TextDocument();
Line 18: Line 18:
 
//Save
 
//Save
 
document.SaveTo("XLink.odt");
 
document.SaveTo("XLink.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]]

Latest revision as of 12:42, 22 May 2022

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.

Personal tools