21.08.2013 Views

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The StarDesktop 79<br />

loadComponentFromURL Method Options<br />

The fourth parameter of the loadComponentFromURL function is a PropertyValue data<br />

field. which provides <strong>OpenOffice</strong>.<strong>org</strong> with various options for opening and creating<br />

documents. The data field must provide a PropertyValue structure for each option in which<br />

the name of the option is saved as a string as well as the associated value.<br />

loadComponentFromURL supports the following options:<br />

AsTemplate (Boolean)<br />

if true, loads a new, untitled document from the given URL. If is false, template files<br />

are loaded for editing.<br />

CharacterSet (String)<br />

defines which set of characters a document is based on.<br />

FilterName (String)<br />

specifies a special filter for the loadComponentFromURL function. The filter names<br />

available are defined in the<br />

\share\config\registry\instance\<strong>org</strong>\openoffice\office\TypeDetection.xml file.<br />

FilterOptions (String)<br />

defines additional options for filters.<br />

JumpMark (String)<br />

once a document has been opened, jumps to the position defined in JumpMark.<br />

Password (String)<br />

transfers a password for a protected file.<br />

ReadOnly (Boolean)<br />

loads a read-only document.<br />

The following example shows how a text file separated by a comma in <strong>OpenOffice</strong>.<strong>org</strong> Calc<br />

can be opened using the FilterName option.<br />

Dim Doc As Object<br />

Dim FileProperties(1) As New com.sun.star.beans.PropertyValue<br />

Dim Url As String<br />

Url = "file:///C:/doc.csv"<br />

FileProperties(0).Name = "FilterName"<br />

FileProperties(0).Value ="Text - txt - csv (StarCalc)"<br />

FileProperties(1).Name = "FilterOptions"<br />

FileProperties(1).value = "44,34,0,1"<br />

Doc = StarDesktop.loadComponentFromURL(Url, "_blank", 0,<br />

FileProperties())<br />

The FileProperties data field covers precisely one value because it records one option. The<br />

Filtername property defines whether <strong>OpenOffice</strong>.<strong>org</strong> uses a <strong>OpenOffice</strong>.<strong>org</strong> Calc text filter<br />

to open files.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!