The XComponentLoader Interface


The desktop implements the com.sun.star.frame.XComponentLoader interface. This is a simple interface to load components from a URL. Use the method LoadComponentFromUrl() defined in the XComponentLoader interface to load an existing document or create a new one.

 com.sun.star.lang.XComponent loadComponentFromUrl(   String aURL,   String aTargetFrameName,   Long nSearchFlags,   sequence< com::sun::star::beans::PropertyValue > aArgs) 

The first argument to the method LoadComponentFromUrl() specifies the URL of the document to load. To load an existing document, provide the URL of the document. Use the function ConvertToURL to convert a file name expressed in an operating-system-specific format to a URL.

 Print ConvertToURL("c:\temp\file.txt") 'file:///c:/temp/file.txt 

The URL may indicate a local file, or even a file on the Internet (see Listing 11 ). I recommend obtaining a highspeed Internet connection before running this macro because it loads a 300-page document.

Listing 11: LoadMacroDocFromHttp is found in the Desktop module in this chapter's source code files as SC11.sxw.
start example
 Sub LoadMacroDocFromHttp   Dim noArgs()          'An empty array for the arguments.   Dim vComp             'The loaded component   Dim sURL As String    'URL of the document to load   sURL = "http://www.pitonyak.org/AndrewMacro.sxw"   vComp = StarDesktop.LoadComponentFromUrl(sURL, "_blank", 0, noArgs()) End Sub 
end example
 

OOo uses special URLs to indicate that a new document, rather than an existing document, should be created (see Table 3 ).

Table 3: URLS for creating new documents.

URL

Document Type

"private:factory/scalc"

Calc document

"private:factory/swriter"

Writer document

"private:factory/swriter/web"

Writer HTML Web document

"private:factory/swriter/GlobalDocument"

Master document

"private:factory/sdraw"

Draw document

"private:factory/smath"

Math formula document

"private:factory/simpress"

Impress presentation document

"private:factory/schart"

Chart

".component:Bibliography/View1"

Bibliography-Edit the bibliography entries

".component:DB/QueryDesign"

".component:DB/TableDesign"

".component:DB/RelationDesign"

".component:DB/DataSourceBrowser"

".component:DB/FormGridView"

Database components

The macro in Listing 12 opens five new documents-each in a new window.

Listing 12: LoadEmptyDocuments is found in the Desktop module in this chapter's source code files as SC11.sxw.
start example
 Sub LoadEmptyDocuments   Dim noArgs()          'An empty array for the arguments   Dim vComp             'The loaded component   Dim sURLs()           'URLs of the new document types to load   Dim sURL As String    'URL of the document to load   Dim i As Integer   sURLs = Array("scalc", "swriter", "sdraw", "smath", "simpress")   For i = LBound(sURLs) To UBound(sURLs)     sURL = "private:factory/" & sURLs(i)     vComp = StarDesktop.LoadComponentFromUrl(sURL, "_blank", 0, noArgs())     Next End Sub 
end example
 
Note  

As of OOo 1.1, the Frame object supports the method LoadComponentFromUrl().

When a component (document) is loaded, it is placed into a frame; the second argument to LoadComponentFromUrl() specifies the name of the frame. If a frame with the specified name already exists, the newly loaded document uses the existing frame. The code in Listing 12 demonstrates the special frame name "_blank"-the special frame names are discussed shortly. Other frame names, meaning frame names that are not "special," specify the name of an existing frame or a new frame. If you specify a frame name, you must tell OOo how to find the frame. The values in Table 1 enumerate valid values for the third argument, frame search flags.

In OOo 1.1.0 a document will not load into an existing frame using the Desktop object. Use the frame from a document instead (see Listing 13 ).

Listing 13: UseAnExistingFrame is found in the Desktop module in this chapter's source code files as SC11.sxw.
Warning  
start example
 Sub UseAnExistingFrame   Dim noArgs()         'An empty array for the arguments   Dim vDoc             'The loaded component   Dim sURL As String   'URL of the document to load   Dim nSearch As Long  'Search flags   Dim sFName As String 'Frame Name   Dim vFrame           'Document Frame   Dim s As String      'Display string   REM Search globally for this   nSearch = com.sun.star.frame.FrameSearchFlag.GLOBAL + _             com.sun.star.frame.FrameSearchFlag.CREATE   REM I can even open a real file for this, but I don't know what files   REM you have on your computer so I create a new Writer document instead   REM sURL = "file:///home/andy/doc1.sxw"   sURL = "private:factory/swriter"   REM Create a frame with the name MyFrame rather than _default   sFName = "MyFrame"   vFrame = ThisComponent.CurrentController.Frame   vDoc = vFrame.LoadComponentFromUrl(sURL, sFName, nSearch, noArgs())   If IsNull(vDoc) Then     Print "Failed to create a document"     Exit Sub   End If   REM The name of the frame is MyFrame. Note that the name has nothing   REM to do with the title!   sFName = vDoc.CurrentController.Frame.Name   s = "Created document to frame " & sFName & CHR$(10)   MsgBox s   REM This time, do not allow creation; only allow an existing frame   nSearch = com.sun.star.frame.FrameSearchFlag.Global   'sURL = "file:///home/andy/doc2.sxw"   sURL = "private:factory/scalc"   vDoc = vFrame.LoadComponentFromUrl(sURL, sFName, nSearch, noArgs())   If IsNull(vDoc) Then     Print "Failed to create a document"     Exit Sub   End If   s = s & "Created document to frame " & sFName   MsgBox s End Sub 
end example
 

The code in Listing 13 creates a new text document in a frame named "MyFrame." In OOo 1.1.0, the Desktop object fails to create a document if a frame exists with the same name. After the document is loaded, a different document is loaded into the same frame, replacing the first document.

OOo uses special frame names to specify special behavior (see Table 4 ). Use these special frame names to cause the specified behavior.

Table 4: Special frame names.

Frame Name

Description

"_blank"

Creates a new frame.

"_default"

Detects an already loaded document or creates a new frame if it is not found.

"_self"

Use or return this frame.

""

Use or return this frame.

"_parent"

Use or return the direct parent of this frame.

"_top"

Use or return the highest level parent frame.

"_beamer"

Use or return a special subframe.

Using the frame name "_self' while using the Desktop object will fail. To specify the current frame as the destination object, use the frame to load the component (see Listing 14 ).

Listing 14: ReuseAFrame is found in the Desktop module in this chapter's source code files as SC11.sxw.
start example
 Sub ReuseAFrame   Dim noArgs()          'An empty array for the arguments   Dim vDoc              'The loaded component   Dim sURL As String    'URL of the document to load   Dim nSearch As Long   'Search flags   Dim vFrame            'This will hold a document's frame   nSearch = com.sun.star.frame.FrameSearchFlag.GLOBAL + _             com.sun.star.frame.FrameSearchFlag.CREATE   REM Create an empty Writer document!   sURL = "private:factory/swriter"   REM The loaded component (document) is returned by LoadComponentFromUrl   vDoc = StarDesktop.LoadComponentFromUrl(sURL, "NoName", nSearch, noArgs())   REM Now create an empty Calc document!   REM Obtain the current controller from the document and   REM obtain the frame from the current controller   REM Create the new document and use the existing frame   sURL = "private:factory/scalc"   vFrame = vDoc.CurrentController.Frame   vFrame.LoadComponentFromUrl(sURL, "_self", nSearch, noArgs()) End Sub 
end example
 

Named Parameters

The final argument to the LoadComponentFromUrl() method is an array of structures of type com.sun.star.beans.PropertyValue. Each property value consists of a name and a value. The properties are used to pass named parameters that direct OOo when it loads the document. Table 5 contains a brief description of the supported named parameters.

Table 5: Valid named parameters for loading and storing documents.

Parameter

Description

AsTemplate

A value of True creates a new untitled document, even if the document is not a template. The default loads the template document for editing.

Author

Sets the current author if the component can track the author of the current version when the document is saved.

CharacterSet

Identifies the character set for single-byte characters .

Comment

Similar to Author parameter, but sets the document description for version control.

ComponentData

Allows component-specific properties.

DocumentTitle

Sets the Document title.

FilterName

Name of the filter for loading or storing the component when not using OOo types.

FilterOptions

Additional properties for a filter if it is required.

FilterData

Additional properties for a filter if it is required.

Hidden

A value of False loads the document so that it is hidden. Do not do this if you intend to make the document visible after it is loaded.

InputStream

You can specify an existing input stream for loading a document-for example, if you have the document in memory and don't want to write it to disk first.

InteractionHandler

Passes an interaction handler to handle errors and obtains a password if required.

JumpMark

Jumps to a marked position after loading the component.

MediaType

Specifies the MIME type of the data that will be loaded.

OpenNewView

A value of True forces the component to create a new window even if the document is already loaded. Some components support multiple views to the same data. If the opened component does not support multiple views, a new window is opened. It is not a view, but merely the document loaded one more time.

Overwrite

A value of True overwrites any existing file with the same name while saving.

Password

Password for loading or storing a document. If a document that requires a password is loaded and no password is specified, the document is not loaded.

PostData

Posts data to an HTTP address and then loads the response as a document. PostData is usually used to obtain a result from a Web form on a Web site.

Preview

A value of True specifies that the document is loaded for preview. OOo may make some optimizations when it opens a document in preview mode.

ReadOnly

Opens the document as read-only. Read-only documents are not modifiable from the user interface, but you can modify them by using the OOo API (in other words, from a macro).

StartPresentation

If the document contains a presentation, it is started immediately.

Referer

A URL indicating the referrer who opened this document. Without a referrer, a document that requires security checks is denied . (Yes, the parameter name is "Referer," not "Referrer.")

RepairPackage

OOo documents are stored in a compressed zipped format. A value of True attempts to recover information from a damaged ZIP file.

Statuslndicator

Value is an object to use as a progress indicator as the document is loaded or saved.

TemplateName

Name of the template instead of the URL. Must also use the TemplateRegionName.

TemplateRegionName

Path to the template instead of the URL. Must also use the TemplateName.

Unpacked

OOo stores documents in a zipped format. A value of True stores the file in a folder if it is supported for the component type.

URL

Fully qualified URL of the document to load, including the JumpDescriptor if required.

Version

If versioning is supported for the component, this parameter indicates the version to load or save. The main document is loaded or saved if no version is specified.

ViewData

The value for this parameter is component specific and usually supplied by the frame controller.

ViewId

Some components support different views of the same data. The value specifies the view to use after loading. The default is zero and is treated as the default view.

MacroExecutionMode

The numeric value specifies if macros are executed when the document is loaded ( Table 6 ).

UpdateDocMode

The numeric value specifies how the document is updated. See the API site for the constant com.sun.star.document.UpdateDocMode.

Table 6: com.sun.star.document.MacroExecutionMode constants.

#

Name

Description

NEVER_EXECUTE

Do not execute a macro.

1

FROM_LIST

Execute macros from a list based on configuration.

2

ALWAYS_EXECUTE

Execute, but warn if the configuration says to.

3

USE_CONFIG

Do what the configuration says to do.

4

ALWAYS_EXECUTE_NO_WARN

Run the macro and do not warn.

5

USE_CONFIG_REJECT_CONFIRMATION

The configuration specifies what to do when the user says not to run macros; do that.

6

USE_CONFIG_APPROVE_CONFIRMATION

The configuration specifies what to do when the user says to run macros; do that.

Note  

Table 5 contains only named parameters that are not deprecated. The API Web site on the com.sun.star.document.MediaDescriptor service contains a complete list of named parameters, deprecated and otherwise .

Loading a Template

While loading a document using LoadComponentFromUrl(), the OOo API treats all documents the same. You can open an OOo template for editing (changing a template and then saving it as a new template) or you can use a template as the starting point for a new document. The named parameter AsTemplate directs OOo to open the specified document as a template rather than opening a document for editing. The macro in Listing 15 opens a document as a template.

Listing 15: Load a document as a template.
start example
 Sub UseTemplate   REM This is an array from 0 To 0 of type PropertyValue   Dim args(0) As New com.sun.star.beans.PropertyValue   Dim sURL As String 'URL of the document to load   sURL = "file:///home/andy/docl.sxw"   args(0).Name = "AsTemplate"   args(0).Value = True   StarDesktop.LoadComponentFromUrl(sURL, "_blank", 0, args()) End Sub 
end example
 

The method LoadComponentFromUrl() assumes that a URL is used to specify the document location; this is not operating-system specific. Although I ran the macro in Listing 15 on my Linux computer, it will work on a Windows computer as well. On a Windows computer, the URL usually includes the drive letter.

 sURL = "file://c:/home/andy/docl.sxw" 
Tip  

Use the functions ConvertFromURL and ConvertToURL to convert between the operating-system-specific notation and URL notation.

Enabling Macros While Loading a Document

When a document that contains a macro is opened from the user interface (UI), a security dialog opens, asking if macros should be run. When a document is loaded from a macro using the OOo API, macros are disabled in the document. Some macros run based on events that occur in a document. If macros are disabled in the document, you can still manually run the contained macros, but the macros that are usually started from an event in the document will never run.

The named parameter MacroExecutionMode directs OOo how to treat macros when a document is loaded. Table 6 enumerates the valid values for the MacroExecutionMode parameter.

The macro in Listing 16 loads a document as a template and allows macros to run when the document is loaded. This macro also demonstrates that multiple named parameters can be used simultaneously .

Listing 16: Load a document as a template and enable contained macros.
start example
 Sub UseTemplateRunMacro   REM This is an array from 0 To 1 of type PropertyValue   Dim args(0) As New com.sun.star.beans.PropertyValue   Dim sURL As String 'URL of the document to load    Print com.sun.star.document.MacroExecMode.USE_CONFIG   sURL = "file:///home/andy/docl.sxw"   args(0).Name = "AsTemplate"   args(0).Value = True   args(1).Name = "MacroExecutionMode"   args(1).Value = com.sun.star.document.MacroExecMode.ALWAYS_EXECUTE_NO_WARN   StarDesktop.LoadComponentFromUrl(sURL, "_blank", 0, args()) End Sub 
end example
 

Importing and Exporting Non-OpenOffice.org Documents

OpenOffice.org has a type-detection mechanism to determine a document's type when it is loaded. This mechanism has been reliable for the limited number of document types that I deal with daily. Sometimes, however, you must specify the filter name when importing a document. To export a document, you must always specify the export filter type. The code in Listing 17 opens a Microsoft Word document. In my testing the documents opened correctly even when I did not specify the filter name.

Listing 17: Specify the filter name while loading a document.
start example
 Sub LoadDocFile   Dim noArgs(0) As New com.sun.star.beans.PropertyValue   Dim sURL As String   noArgs(0).Name = "FilterName"   noArgs(0).Value = "Microsoft Word 97/2000/XP"   sURL = "file:///home/andy/one.doc"   StarDesktop.LoadComponentFromUrl(sURL, "_blank", 0, noArgs()) End Sub 
end example
 

Finding the correct filter name requires some investigation in configuration files included with OOo. Starting from the primary OOo installation directory (which is /usr/local/OpenOffice.org1.1.0/ on my Linux computer and C:\Program Files\OpenOffice.org1.1.0\ on my Windows computer) look at the file share/registry/data/org/openoffice/Office/TypeDetection.xcu. This file contains the names of the different filters.

Tip  

Laurent Godard created some excellent macros for exporting documents (see http://oooconv.free.fr/engine/HowToConv.php ).

The desktop or a frame is used to load a document. To store a document, use the method storeToURL(), which is implemented by the Document object. The first argument to this method is the URL to which the document will be stored. The second argument is an array of named parameters (see Table 5). To export a document to a different type, the FilterName must specify the document export type. Tables 8 through 16 contain the current import and export filters as of OOo 1.1.0. The code in Listing 18 exports a Writer document to a PDF file.

Listing 18: Export the current document, assuming it is a Writer document, as PDF.
start example
 Dim args(0) as new com.sun.star.beans.PropertyValue args(0).Name = "FilterName" args(0).Value = "writer_pdf_Export" ThisComponent.storeToURL("file:///test.pdf",args()) 
end example
 
Tip  

The filter name is case sensitive. In OOo Basic and the OOo API, the values of string arguments are usually case sensitive, but almost nothing else is.

The only import and export filters in Tables 8 through 16 that support filter options are Calc import and export filters (see Table 11); however, this will probably change as more filters are introduced. The DIF, dBase, and Lotus filters all use the same filter option, a numeric index that identifies which character set to use for single-byte characters. See Listing 19 .

Listing 19: The DIF, dBase, and Lotus filters all use the same filter option.
start example
 Dim args(1) as new com.sun.star.beans.PropertyValue args(0).Name = "FilterName" args(0).Value = "dBase" args(1).Name = "FilterOptions"   'Identify character set for single-byte chars args(1).Value = 0                'System character set 
end example
 

The discussion of the CSV filter assumes familiarity with the CSV file format. If you aren't familiar with this format, feel free to skip this section. The Text CSV filter, unlike the dBase filter, uses a complicated string containing five tokens. Each token can contain multiple values separated by a slash mark (/). The tokens are then separated by a comma (,). See Listing 20 .

Listing 20: The CSV filter options are complicated.
start example
 Dim args(1) as new com.sun.star.beans.PropertyValue args(0).Name = "FilterName" args(0).Value = "scalc: Text - txt - csv (StarCalc)" args(1).Name = "FilterOptions" args(1).Value = "44,34,0,1,1/5/2/1/3/1/4/1" 
end example
 

The first token contains the field separators as ASCII values. For example, to specify a comma as the delimiter , use the ASCII value 44 (see Listing 20). To specify that some fields are separated by a a space (ASCII 32) and some are separated by a tab (ASCII 9), Listing 20 would use "32/9,34,0,1,1/5/2/1/3/1/4/1" for the filter options.

In a CSV file, the text portions are usually surrounded by either double quotation marks (") or single quotation marks ('). Listing 20 specifies that text portions should be surrounded by double quotation marks, using an ASCII value of 34. If you want to use multiple text delimiters, separate them with a slash.

The third token identifies the character set to use; this is the same value used to identify the character set in the DIF, dBase, and Lotus filters. The code in Listing 20 specifies a zero for the character set.

The fourth token identifies the first line to import-typically line one. Listing 20 specifies that the first line of text should be input.

The last token identifies the format of each column in the CSV file. The columns can be formatted as either delimited text (see Listing 21 ) or as fixed-width text (see Listing 22 ).

Listing 21: Delimited-text-format string for the CSV filter.
start example
 <field_num>/<format>/<field_num>/<format>/<field_num>/<format>/... 
end example
 
Listing 22: Fixed-width-columns format string for the CSV filter.
start example
 FIX/<start>/<format>/<start>/<format>/<start>/<format>/... 
end example
 

The <field_num> is an integer that identifies a field, where 1 is the leftmost field. For example, given the fields "one", "two", and "three", a field_num of 2 refers to "two". The <format> is an integer that identifies the format of the field (see Table 7 ). The code in Listing 20 specifies that fields one through four use a format of 1, which is the standard format.

Table 7: CSV field format values.

Format

Description

1

Standard

2

Text

3

MM/DD/YY

4

DD/MM/YY

5

YY/MM/DD

9

Do not import; ignore this field.

10

Import a number formatted in the US-English locale regardless of the current locale.

Tell the filter that the file uses a fixed-width format by using the text "FIX" as the first portion of the last token. Fixed-width CSV files identify fields by specifying where each field starts (see Listing 22). The <start> value specifies the first character in a field. A start of 0 refers to the leftmost character of the text. The <format> is an integer that identifies the format of the text (see Table 7).

Table 8 through Table 16 contain the current import and export filters as of OOo 1.1.0. The Localized Name column contains the general name of the filter. The Internal Name column contains the name to use when specifying a filter name for import or export. The Import and Export columns identify if the filter can be used for import or export. The final column, Uses Options, indicates if options can be passed to the filter. These options direct the filter.

Module Writer

Table 8: Writer import and export filter names.

Localized Name

Internal Name

Import

Export

Uses Options

Ami Pro 1.x-3.1

Ami Pro 1.x-3.1 (W4W)

X

-

-

AportisDoc (Palm)

AportisDoc Palm DB

X

X

-

Claris Works

Claris Works (W4W)

X

-

-

CTOS DEF

CTOS DEF (W4W)

X

-

-

DataGeneral CEO Write

DataGeneral CEO Write (W4W)

X

-

-

DCA Revisable Form Text

DCA Revisable Form Text (W4W)

X

-

-

DCA with Display Write 5

DCA with Display Write 5 (W4W)

X

-

-

DCA/FFT-Final Form Text

DCA/FFT-Final Form Text (W4W)

X

-

-

DEC DX

DEC DX (W4W)

X

-

-

DEC WPS-PLUS

DEC WPS-PLUS (W4W)

X

-

-

DisplayWrite 2.0-4.x

DisplayWrite 2.0-4.x (W4W)

X

-

-

DisplayWrite 5.x

DisplayWrite 5.x (W4W)

X

-

-

EBCDIC

EBCDIC (W4W)

X

-

-

Enable

Enable (W4W)

X

-

-

Frame Maker MIF 3.0

Frame Maker MIF 3.0 (W4W)

X

-

-

Frame Maker MIF 4.0

Frame Maker MIF 4.0 (W4W)

X

-

-

Frame Maker MIF 5.0

Frame Maker MIF 5.0 (W4W)

X

-

-

Frame Work III

Frame Work III (W4W)

X

-

-

Frame Work IV

Frame Work IV (W4W)

X

-

-

Hangul WP 97

writer_MIZI_Hwp_97

X

-

-

HP AdvanceWrite Plus

HP AdvanceWrite Plus (W4W)

X

-

-

HTML Document (StarOffice Writer)

HTML (StarWriter)

X

X

-

Ichitaro 8/9/10/11

writer_JustSystem_Ichitaro_10

X

-

-

Ichitaro 8/9/10/11 Template

writer_JustSystem_Ichitaro_10_template

X

-

-

ICL Office Power 6

ICL Office Power 6 (W4W)

X

-

-

ICL Office Power 7

ICL Office Power 7 (W4W)

X

-

-

Interleaf

Interleaf (W4W)

X

-

-

Interleaf 5 - 6

Interleaf 5 - 6 (W4W)

X

-

-

Legacy Winstar onGO

Legacy Winstar onGO (W4W)

X

-

-

Lotus 1-2-3 1.0 DOS (StarOffice Writer)

Lotus 1-2-3 1.0 (DOS) (StarWriter)

X

-

-

Lotus 1-2-3 1.0 WIN (StarOffice Writer)

Lotus 1-2-3 1.0 (WIN) (StarWriter)

X

-

-

Lotus Manuscript

Lotus Manuscript (W4W)

X

-

-

Mac Write 4.x 5.0

Mac Write 4.x 5.0 (W4W)

X

-

-

Mac Write II

Mac Write II (W4W)

X

-

-

Mac Write Pro

Mac Write Pro (W4W)

X

-

-

MASS 11 Rel. 8.0-8.3

MASS 11 Rel. 8.0-8.3 (W4W)

X

-

-

MASS 11 Rel. 8.5-9.0

MASS 11 Rel. 8.5-9.0 (W4W)

X

-

-

Microsoft Excel 4.0 (StarOffice Writer)

MS Excel 4.0 (StarWriter)

X

-

-

Microsoft Excel 5.0 (StarOffice Writer)

MS Excel 5.0 (StarWriter)

X

-

-

Microsoft Excel 95 (StarOffice Writer)

MS Excel 95 (StarWriter)

X

-

-

Microsoft MacWord 3.0

MS MacWord 3.0 (W4W)

X

-

-

Microsoft MacWord 4.0

MS MacWord 4.0 (W4W)

X

-

-

Microsoft MacWord 5.x

MS MacWord 5.x (W4W)

X

-

-

Microsoft WinWord 1.x

MS WinWord 1.x (W4W)

X

-

-

Microsoft WinWord 2.x

MS WinWord 2.x (W4W)

X

-

-

Microsoft WinWord 5

MS WinWord 5

X

-

-

Microsoft Word 3.x

MS Word 3.x (W4W)

X

-

-

Microsoft Word 4.x

MS Word 4.x (W4W)

X

-

-

Microsoft Word 5.x

MS Word 5.x (W4W)

X

-

-

Microsoft Word 6.0

MS WinWord 6.0

X

X

-

Microsoft Word 6.x

MS Word 6.x (W4W)

X

-

-

Microsoft Word 95

MS Word 95

X

X

-

Microsoft Word 95 Template

MS Word 95 Vorlage

X

-

-

Microsoft Word 97/2000/XP

MS Word 97

X

X

-

Microsoft Word 97/2000/XP Template

MS Word 97 Vorlage

X

-

-

Microsoft Works 2.0 DOS

MS Works 2.0 DOS (W4W)

X

-

-

Microsoft Works 3.0 Win

MS Works 3.0 Win (W4W)

X

-

-

Microsoft Works 4.0 Mac

MS Works 4.0 Mac (W4W)

X

-

-

MultiMate 3.3

MultiMate 3.3 (W4W)

X

-

-

MultiMate 4

MultiMate 4 (W4W)

X

-

-

MultiMate Adv. 3.6

MultiMate Adv. 3.6 (W4W)

X

-

-

MultiMate Adv. II 3.7

MultiMate Adv. II 3.7 (W4W)

X

-

-

NAVY DIF

NAVY DIF (W4W)

X

-

-

OfficeWriter 4.0

OfficeWriter 4.0 (W4W)

X

-

-

OfficeWriter 5.0

OfficeWriter 5.0 (W4W)

X

-

-

OfficeWriter 6.x

OfficeWriter 6.x (W4W)

X

-

-

PDF - Portable Document Format

writer_pdf_Export

-

X

-

Peach Text

Peach Text (W4W)

X

-

-

PFS First Choice 1.0

PFS First Choice 1.0 (W4W)

X

-

-

PFS First Choice 2.0

PFS First Choice 2.0 (W4W)

X

-

-

PFS First Choice 3.0

PFS First Choice 3.0 (W4W)

X

-

-

PFS Professional Write 1.0

Professional Write 1.0 (W4W)

X

-

-

PFS Professional Write 2.x

Professional Write 2.x (W4W)

X

-

-

PFS Professional Write Plus

Professional Write Plus (W4W)

X

-

-

PFS Write

PFS Write (W4W)

X

-

-

Pocket Word

PocketWord File

X

X

-

Q&A Write 1.0-3.0

Q&A Write 1.0-3.0 (W4W)

X

-

-

Q&A Write 4.0

Q&A Write 4.0 (W4W)

X

-

-

Rapid File 1.0

Rapid File 1.0 (W4W)

X

-

-

Rapid File 1.2

Rapid File 1.2 (W4W)

X

-

-

Rich Text Format

Rich Text Format

X

X

-

Samna Word IV-IV Plus

Samna Word IV-IV Plus (W4W)

X

-

-

StarOffice 6.0 Text Document

StarOffice XML (Writer)

X

X

-

StarOffice 6.0 Text Document Template

writer_StarOffice_XML_Writer_Template

X

X

-

StarWriter 1.0

StarWriter 1.0

X

-

-

StarWriter 2.0

StarWriter 2.0

X

-

-

StarWriter 3.0

StarWriter 3.0

X

X

-

StarWriter 3.0 Template

StarWriter 3.0 Vorlage/Template

X

X

-

StarWriter 4.0

StarWriter 4.0

X

X

-

StarWriter 4.0 Template

StarWriter 4.0 Vorlage/Template

X

X

-

StarWriter 5.0

StarWriter 5.0

X

X

-

StarWriter 5.0 Template

StarWriter 5.0 Vorlage/Template

X

X

-

StarWriter DOS

StarWriter DOS

X

-

-

Text

Text

X

X

-

Text Encoded

Text (encoded)

X

X

-

Total Word

Total Word (W4W)

X

-

-

Uniplex onGO

Uniplex onGO (W4W)

X

-

-

Uniplex V7-V8

Uniplex V7-V8 (W4W)

X

-

-

VolksWriter 3 and 4

VolksWriter 3 and 4 (W4W)

X

-

-

VolksWriter Deluxe

VolksWriter Deluxe (W4W)

X

-

-

Wang II SWP

Wang II SWP (W4W)

X

-

-

Wang PC

Wang PC (W4W)

X

-

-

Wang WP Plus

Wang WP Plus (W4W)

X

-

-

Win Write 3.x

Win Write 3.x (W4W)

X

-

-

WITA

WITA (W4W)

X

-

-

WiziWord 3.0

WiziWord 3.0 (W4W)

X

-

-

WordPerfect (Win) 5.1-5.2

WordPerfect (Win) 5.1-5.2 (W4W)

X

-

-

WordPerfect (Win) 6.0

WordPerfect (Win) 6.0 (W4W)

X

-

-

WordPerfect (Win) 6.1

WordPerfect (Win) 6.1 (W4W)

X

-

-

WordPerfect (Win) 7.0

WordPerfect (Win) 7.0 (W4W)

X

-

-

WordPerfect 4.1

WordPerfect 4.1 (W4W)

X

-

-

WordPerfect 4.2

WordPerfect 4.2 (W4W)

X

-

-

WordPerfect 5.0

WordPerfect 5.0 (W4W)

X

-

-

WordPerfect 5.1

WordPerfect 5.1 (W4W)

X

-

-

WordPerfect 6.0

WordPerfect 6.0 (W4W)

X

-

-

WordPerfect 6.1

WordPerfect 6.1 (W4W)

X

-

-

WordPerfect Mac 1

WordPerfect Mac 1 (W4W)

X

-

-

WordPerfect Mac 2

WordPerfect Mac 2 (W4W)

X

-

-

WordPerfect Mac 3

WordPerfect Mac 3 (W4W)

X

-

-

WordStar (Win) 1.x-2.0

WordStar (Win) 1.x-2.0 (W4W)

X

-

-

WordStar 2000 Rel. 3.0

WordStar 2000 Rel. 3.0 (W4W)

X

-

-

WordStar 2000 Rel. 3.5

WordStar 2000 Rel. 3.5 (W4W)

X

-

-

WordStar 3.3x

WordStar 3.3x (W4W)

X

-

-

WordStar 3.45

WordStar 3.45 (W4W)

X

-

-

WordStar 4.0

WordStar 4.0 (W4W)

X

-

-

WordStar 5.0

WordStar 5.0 (W4W)

X

-

-

WordStar 5.5

WordStar 5.5 (W4W)

X

-

-

WordStar 6.0

WordStar 6.0 (W4W)

X

-

-

WordStar 7.0

WordStar 7.0 (W4W)

X

-

-

WPS 2000/Office 1.0

writer_WPSSystem_WPS2000_10

X

-

-

WriteNow 3.0 (Macintosh)

WriteNow 3.0 (Macintosh) (W4W)

X

-

-

Writing Assistant

Writing Assistant (W4W)

X

-

-

XEROX XIF 5.0

XEROX XIF 5.0 (W4W)

X

-

-

XEROX XIF 5.0 (Illustrator)

XEROX XIF 5.0 (Illustrator) (W4W)

X

-

-

XEROX XIF 6.0 ( Color Bitmap)

XEROX XIF 6.0 (Color Bitmap) (W4W)

X

-

-

XEROX XIF 6.0 (Res Graphic)

XEROX XIF 6.0 (Res Graphic) (W4W)

X

-

-

XyWrite (Win) 1.0

XyWrite (Win) 1.0 (W4W)

X

-

-

XyWrite III

XyWrite III (W4W)

X

-

-

XyWrite III+

XyWrite III+ (W4W)

X

-

-

XyWrite IV

XyWrite IV (W4W)

X

-

-

XyWrite Sig. (Win)

XyWrite Sig. (Win) (W4W)

X

-

-

XyWrite Signature

XyWrite Signature (W4W)

X

-

-

Module Writer Web

Table 9: Writer Web import and export filter names.

Localized Name

Internal Name

Import

Export

Uses Options

Help content

writer_web_HTML_help

X

-

-

HTML Document

HTML

X

X

-

PDF - Portable Document Format

writer_web_pdf_Export

-

X

-

StarOffice 6.0 HTML Template

writer_web_StarOffice_XML_Writer_Web_ Template

X

X

-

StarOffice Text Document (StarOffice Writer/Web)

writer_web_StarOffice_XML_Writer

-

X

-

StarWriter 3.0 (StarOffice Writer/Web)

StarWriter 3.0 (StarWriter/Web)

-

X

-

StarWriter 4.0 (StarOffice Writer/Web)

StarWriter 4.0 (StarWriter/Web)

-

X

-

StarWriter 5.0 (StarOffice Writer/Web)

StarWriter 5.0 (StarWriter/Web)

-

X

-

StarWriter/Web 4.0 Template

StarWriter/Web 4.0 Vorlage/Template

X

X

-

StarWriter/Web 5.0 Template

StarWriter/Web 5.0 Vorlage/Template

X

X

-

Text (StarOffice Writer/Web)

Text (StarWriter/Web)

X

X

-

Text Encoded (StarOffice Writer/Web)

Text (encoded) (StarWriter/Web)

X

X

-

Module Writer Global

Table 10: Writer Global import and export filter names.

Localized Name

Internal Name

Import

Export

Uses Options

PDF - Portable Document Format

writer_globaldocument_pdf_Export

-

X

-

StarOffice 6.0 Master Document

writer_globaldocument_StarOffice_XML_Writer_GlobalDocument

X

X

-

StarOffice 6.0 Text Document

writer_globaldocument_StarOffice_XML_Writer

-

X

-

StarWriter 3.0

StarWriter 3.0 (StarWriter/GlobalDocument)

-

X

-

StarWriter 4.0

StarWriter 4.0 (StarWriter/GlobalDocument)

-

X

-

StarWriter 4.0 Master Document

StarWriter 4.0/GlobalDocument

X

X

-

StarWriter 5.0

StarWriter 5.0 (StarWriter/GlobalDocument)

-

X

-

StarWriter 5.0 Master Document

StarWriter 5.0/GlobalDocument

X

X

-

Text Encoded (StarOffice Master Document)

Text (encoded) (StarWriter/GlobalDocument)

X

X

-

Module Calc

Table 11: Calc import and export filter names.

Localized Name

Internal Name

Import

Export

Uses Options

Data Interchange Format

DIF

X

X

X

dBASE

dBase

X

X

X

HTML Document (StarOffice Calc)

HTML (StarCalc)

X

X

-

Lotus 1-2-3

Lotus

X

-

X

Microsoft Excel 4.0

MS Excel 4.0

X

-

-

Microsoft Excel 4.0 Template

MS Excel 4.0 Vorlage/Template

X

-

-

Microsoft Excel 5.0

MS Excel 5.0/95

X

X

-

Microsoft Excel 5.0 Template

MS Excel 5.0/95 Vorlage/Template

X

X

-

Microsoft Excel 95

MS Excel 95

X

X

-

Microsoft Excel 95 Template

MS Excel 95 Vorlage/Template

X

X

-

Microsoft Excel 97/2000/XP

MS Excel 97

X

X

-

Microsoft Excel 97/2000/XP Template

MS Excel 97 Vorlage/Template

X

X

-

PDF - Portable Document Format

calc_pdf_Export

-

X

-

Pocket Excel

Pocket Excel

X

X

-

Rich Text Format (StarOffice Calc)

Rich Text Format (StarCalc)

X

-

-

StarCalc 1.0

StarCalc 1.0

X

-

-

StarCalc 3.0

StarCalc 3.0

X

X

-

StarCalc 3.0 Template

StarCalc 3.0 Vorlage/Template

X

X

-

StarCalc 4.0

StarCalc 4.0

X

X

-

StarCalc 4.0 Template

StarCalc 4.0 Vorlage/Template

X

X

-

StarCalc 5.0

StarCalc 5.0

X

X

-

StarCalc 5.0 Template

StarCalc 5.0 Vorlage/Template

X

X

-

StarOffice 6.0 Spreadsheet

StarOffice XML (Calc)

X

X

-

StarOffice 6.0 Spreadsheet Template

calc_StarOffice_XML_Calc_Template

X

X

-

SYLK

SYLK

X

X

-

Text CSV

Text - txt - csv (StarCalc)

X

X

X

Web Page Query (StarOffice Calc)

calc_HTML_WebQuery

X

-

-

Module Draw

Table 12: Draw import and export filter names.

Localized Name

Internal Name

Import

Export

Uses Options

BMP - Windows Bitmap

BMP - MS Windows

X

-

-

BMP - Windows Bitmap

draw_bmp_Export

-

X

-

DXF - AutoCAD Interchange Format

DXF - AutoCAD Interchange

X

-

-

EMF - Enhanced Metafile

draw_emf_Export

-

X

-

EMF - Enhanced Metafile

EMF - MS Windows Metafile

X

-

-

EPS - Encapsulated PostScript

draw_eps_Export

-

X

-

EPS - Encapsulated PostScript

EPS - Encapsulated PostScript

X

-

-

GIF - Graphics Interchange Format

GIF - Graphics Interchange

X

-

-

GIF - Graphics Interchange Format

draw_gif_Export

-

X

-

HTML Document (StarOffice Draw)

draw_html_Export

-

X

-

JPEG - Joint Photographic Experts Group

JPG - JPEG

X

-

-

JPEG - Joint Photographic Experts Group

draw_jpg_Export

-

X

-

MET - OS/2 Metafile

MET - OS/2 Metafile

X

-

-

MET - OS/2 Metafile

draw_met_Export

-

X

-

PBM - Portable Bitmap

PBM - Portable Bitmap

X

-

-

PBM - Portable Bitmap

draw_pbm_Export

-

X

-

PCD - Kodak Photo CD (192x128)

draw_PCD_Photo_CD_Base16

X

-

-

PCD - Kodak Photo CD (384x256)

draw_PCD_Photo_CD_Base4

X

-

-

PCD - Kodak Photo CD (768x512)

draw_PCD_Photo_CD_Base

X

-

-

PCT - Mac Pict

PCT - Mac Pict

X

-

-

PCT - Mac Pict

draw_pct_Export

-

X

-

PCX - Zsoft Paintbrush

PCX - Zsoft Paintbrush

X

-

-

PDF - Portable Document Format

draw_pdf_Export

-

X

-

PGM - Portable Graymap

PGM - Portable Graymap

X

-

-

PGM - Portable Graymap

draw_pgm_Export

-

X

-

PNG - Portable Network Graphic

PNG - Portable Network Graphic

X

-

-

PNG - Portable Network Graphic

draw_png_Export

-

X

-

PPM - Portable Pixelmap

PPM - Portable Pixelmap

X

-

-

PPM - Portable Pixelmap

draw_ppm_Export

-

X

-

PSD - Adobe Photoshop

PSD - Adobe Photoshop

X

-

-

RAS - Sun Raster Image

draw_ras_Export

-

X

-

RAS - Sun Raster Image

RAS - Sun Rasterfile

X

-

-

SGF - StarWriter Graphics Format

SGF - StarOffice Writer SGF

X

-

-

SGV - StarDraw 2.0

SGV - StarDraw 2.0

X

-

-

StarDraw 3.0

StarDraw 3.0

X

X

-

StarDraw 3.0 Template

StarDraw 3.0 Vorlage

X

X

-

StarDraw 5.0

StarDraw 5.0

X

X

-

StarDraw 5.0 Template

StarDraw 5.0 Vorlage

X

X

-

StarOffice 6.0 Drawing

StarOffice XML (Draw)

X

X

-

StarOffice 6.0 Drawing Template

draw_StarOffice_XML_Draw_Template

X

X

-

SVG - Scalable Vector Graphics

draw_svg_Export

-

X

-

SVM - StarView Metafile

draw_svm_Export

-

X

-

SVM - StarView Metafile

SVM - StarView Metafile

X

-

-

TGA - Truevision Targa

TGA - Truevision TARGA

X

-

-

TIFF - Tagged Image File Format

TIF - Tag Image File

X

-

-

TIFF - Tagged Image File Format

draw_tif_Export

-

X

-

WMF - Windows Metafile

draw_wmf_Export

-

X

-

WMF - Windows Metafile

WMF - MS Windows Metafile

X

-

-

XBM - X Bitmap

XBM - X-Consortium

X

-

-

XPM - X PixMap

draw_xpm_Export

-

X

-

XPM - X PixMap

XPM

X

-

-

Module Impress

Table 13: Impress import and export filter names.

Localized Name

Internal Name

Import

Export

Uses Options

BMP - Windows Bitmap

impress_bmp_Export

-

X

-

CGM - Computer Graphics Metafile

CGM - Computer Graphics Metafile

X

-

-

EMF - Enhanced Metafile

impress_emf_Export

-

X

-

EPS - Encapsulated PostScript

impress_eps_Export

-

X

-

GIF - Graphics Interchange Format

impress_gif_Export

-

X

-

HTML Document (StarOffice Impress)

impress_html_Export

-

X

-

JPEG - Joint Photographic Experts Group

impress_jpg_Export

-

X

-

MET - OS/2 Metafile

impress_met_Export

-

X

-

Microsoft PowerPoint 97/2000/XP

MS PowerPoint 97

X

X

-

Microsoft PowerPoint 97/2000/XP Template

MS PowerPoint 97 Vorlage

X

X

-

PBM - Portable Bitmap

impress_pbm_Export

-

X

-

PCT - Mac Pict

impress_pct_Export

-

X

-

PDF - Portable Document Format

impress_pdf_Export

-

X

-

PGM - Portable Graymap

impress_pgm_Export

-

X

-

PNG - Portable Network Graphic

impress_png_Export

-

X

-

PPM - Portable Pixelmap

impress_ppm_Export

-

X

-

PWP - PlaceWare

placeware_Export

-

X

-

RAS - Sun Raster Image

impress_ras_Export

-

X

-

StarDraw 3.0 (StarOffice Impress)

StarDraw 3.0 (Starlmpress)

X

X

-

StarDraw 3.0 Template (StarOffice Impress)

StarDraw 3.0 Vorlage (Starlmpress)

X

X

-

StarDraw 5.0 (StarOffice Impress)

StarDraw 5.0 (Starlmpress)

X

X

-

StarDraw 5.0 Template (StarOffice Impress)

StarDraw 5.0 Vorlage (Starlmpress)

X

X

-

Starlmpress 4.0

Starlmpress 4.0

X

X

-

Starlmpress 4.0 Template

Starlmpress 4.0 Vorlage

X

X

-

Starlmpress 5.0

Starlmpress 5.0

X

X

-

Starlmpress 5.0 Packed

Starlmpress 5.0 (packed)

X

-

-

Starlmpress 5.0 Template

Starlmpress 5.0 Vorlage

X

X

-

StarOffice 6.0 Drawing (StarOffice Impress)

impress_StarOffice_XML_Draw

X

X

-

StarOffice 6.0 Presentation

StarOffice XML (Impress)

X

X

-

StarOffice 6.0 Presentation Template

impress_StarOffice_XML_Impress_Template

X

X

-

SVG - Scalable Vector Graphics

impress_svg_Export

-

X

-

SVM - StarView Metafile

impress_svm_Export

-

X

-

TIFF - Tagged Image File Format

impress_tif_Export

-

X

-

WMF - Windows Metafile

impress_wmf_Export

-

X

-

XPM - X PixMap

impress_xpm_Export

-

X

-

Module Chart

Table 14: Chart import and export filter names.

Localized Name

Internal Name

Import

Export

Uses Options

StarChart 3.0

StarChart 3.0

X

X

-

StarChart 4.0

StarChart 4.0

X

X

-

StarChart 5.0

StarChart 5.0

X

X

-

StarOffice 6.0 Chart

StarOffice XML (Chart)

X

X

-

Module Math

Table 15: Math import and export filter names.

Localized Name

Internal Name

Import

Export

Uses Options

MathML 1.01

MathML XML (Math)

X

X

-

MathType3.x

MathType 3.x

X

X

-

PDF - Portable Document Format

math_pdf_Export

-

X

-

StarMath 2.0

StarMath 2.0

X

-

-

StarMath 3.0

StarMath 3.0

X

X

-

StarMath 4.0

StarMath 4.0

X

X

-

StarMath 5.0

StarMath 5.0

X

X

-

StarOffice 6.0 Formula

StarOffice XML (Math)

X

X

-

Module Graphics

Table 16: Graphics import and export filter names.

Localized Name

Internal Name

Import

Export

Uses Options

BMP - Windows Bitmap

bmp_Import

X

-

-

BMP - Windows Bitmap

bmp_Export

-

X

-

DXF - AutoCAD Interchange Format

dxf_Import

X

-

-

EMF - Enhanced Metafile

emf_Export

-

X

-

EMF - Enhanced Metafile

emf_Import

X

-

-

EPS - Encapsulated PostScript

eps_Export

-

X

-

EPS - Encapsulated PostScript

eps_Import

X

-

-

GIF - Graphics Interchange Format

gif_Import

X

-

-

GIF - Graphics Interchange Format

gif_Export

-

X

-

JPEG - Joint Photographic Experts Group

jpg_Export

-

X

-

JPEG - Joint Photographic Experts Group

jpg_Import

X

-

-

MET - OS/2 Metafile

met_Export

-

X

-

MET - OS/2 Metafile

met_Import

X

-

-

PBM - Portable Bitmap

pbm_Export

-

X

-

PBM - Portable Bitmap

pbm_Import

X

-

-

PCD - Kodak Photo CD (192x128)

pcd_Import_Base16

X

-

-

PCD - Kodak Photo CD (384x256)

pcd_Import_Base4

X

-

-

PCD - Kodak Photo CD (768x512)

pcd_Import_Base

X

-

-

PCT - Mac Pict

pct_Export

-

X

-

PCT - Mac Pict

pct_Import

X

-

-

PCX - Zsoft Paintbrush

pcx_Import

X

-

-

PGM - Portable Graymap

pgm_Export

-

X

-

PGM - Portable Graymap

pgm_Import

X

-

-

PNG - Portable Network Graphic

png_Export

-

X

-

PNG - Portable Network Graphic

png_Import

X

-

-

PPM - Portable Pixelmap

ppm_Export

-

X

-

PPM - Portable Pixelmap

ppm_Import

X

-

-

PSD - Adobe Photoshop

psd_Import

X

-

-

RAS - Sun Raster Image

ras_Import

X

-

-

RAS - Sun Raster Image

ras_Export

-

X

-

SGF - StarWriter Graphics Format

sgf_Import

X

-

-

SGV - StarDraw 2.0

sgv_Import

X

-

-

SVG - Scalable Vector Graphics

svg_Export

-

X

-

SVM - StarView Metafile

Svm_Export

-

X

-

SVM - StarView Metafile

Svm_Import

X

-

-

TGA - Truevision Targa

tga_Import

X

-

-

TIFF - Tagged Image File Format

tif_Export

-

X

-

TIFF - Tagged Image File Format

Tif_Import

X

-

-

WMF - Windows Metafile

wmf_Export

-

X

-

WMF - Windows Metafile

wmf_Import

X

-

-

XBM - X Bitmap

xbm_Import

X

-

-

XPM - X PixMap

xpm_Import

X

-

-

XPM - X PixMap

xpm_Export

-

X

-

Error Handling While Loading a Document

When a document is loaded, no exceptions occur. Instead, errors are thrown using an interaction handler that is passed in as a named parameter. Unfortunately, as of OOo 1.1.0, it is not possible to implement an interaction handler in OOo Basic. The OOo Developer's Guide, however, has examples of error handlers using other languages. In other words, in BASIC, you cannot trap errors while loading a document; the document simply fails to load and returns a null document.

The Graphical User Interface (GUI) provides an interaction handler that interacts with the user. The GUI's interaction handler displays error messages when errors occur and prompts the user for a password if it is required. If no handler is included as a named parameter, a default handler is used. The default handler simply ignores most errors, providing little feedback to the user. Hopefully this will be improved in later versions of OOo.




OpenOffice.org Macros Explained
OpenOffice.org Macros Explained
ISBN: 1930919514
EAN: 2147483647
Year: 2004
Pages: 203

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net