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 82<br />

storeAsURL Method Options<br />

As with the loadComponentFromURL method, some options can also be specified in the<br />

form of a PropertyValue data field using the storeAsURL method. These determine the<br />

procedure <strong>OpenOffice</strong>.<strong>org</strong> uses when saving a document. storeAsURL provides the<br />

following options:<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 />

Overwrite (Boolean)<br />

allows a file which already exists to be overwritten without a query.<br />

Password (String)<br />

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

Unpacked (Boolean)<br />

saves the document (not compressed) in sub-directories.<br />

The following example shows how the Overwrite option can be used in conjunction with<br />

storeAsURL:<br />

Dim Doc As Object<br />

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

Dim Url As String<br />

' ... Initialize Doc<br />

Url = "file:///c:/test3.odt"<br />

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

FileProperties(0).Value = True<br />

Doc.storeAsURL(sUrl, mFileProperties())<br />

The example then saves Doc under the specified file name if a file already exists under the<br />

name.

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

Saved successfully!

Ooh no, something went wrong!