Difference between revisions of "Documentation/DevGuide/Drawings/Handling Presentation Document Files"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Robot: Changing Category:Drawing Documents and Presentation Documents)
m (FINAL VERSION FOR L10N)
Line 5: Line 5:
 
|NextPage=Documentation/DevGuide/Drawings/Printing Presentation Documents
 
|NextPage=Documentation/DevGuide/Drawings/Printing Presentation Documents
 
}}
 
}}
{{DISPLAYTITLE:Handling Presentation Document Files}}
+
{{Documentation/DevGuideLanguages|Documentation/DevGuide/Drawings/{{SUBPAGENAME}}}}
 +
{{DISPLAYTITLE:Handling Presentation Document Files}}
 
=== Creating and Loading Presentation Documents ===
 
=== Creating and Loading Presentation Documents ===
  

Revision as of 12:15, 15 May 2009



Creating and Loading Presentation Documents

The URL that must be used with loadComponentFromURL() for new presentation documents is "private:factory/simpress".

To avoid the initial dialog in new presentation documents, set the property Silent defined in com.sun.star.document.MediaDescriptor to true. This property has to be used with the sequence of PropertyValue structs that is passed to loadComponentFromURL().

The snippet below loads a new presentation document in silent mode:

 // the method getRemoteServiceManager is described in the chapter First Steps
 mxRemoteServiceManager = this.getRemoteServiceManager();
 
 // retrieve the Desktop object, we need its XComponentLoader
 Object desktop = mxRemoteServiceManager.createInstanceWithContext(
     "com.sun.star.frame.Desktop", mxRemoteContext);
 
 // query the XComponentLoader interface from the Desktop service
 XComponentLoader xComponentLoader = (XComponentLoader)UnoRuntime.queryInterface(
     XComponentLoader.class, desktop);
 
 // define load properties according to com.sun.star.document.MediaDescriptor
 // the boolean property Silent tells the office to suppress the impress startup wizard
 PropertyValue[] loadProps = new PropertyValue[1];
 loadProps[0] = new PropertyValue();
 loadProps[0].Name = "Silent";
 loadProps[0].Value = new Boolean(true); 
 
 // load
 com.sun.star.uno.XComponent xComponentLoader.loadComponentFromURL(
     "private:factory/simpress", "_blank", 0, loadProps); 
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages