| <?xml version="1.0"?> | |
| <!-- | |
| $RCSfile: Writer.PrintExistingDocument.snip,v $ | |
| last change: $Revision: 1.1 $ $Author: tomsontom $ $Date: 2006/07/14 09:36:46 $ | |
| (c)2003 by the copyright holders listed with the author-tags. | |
| If no explicit copyright holder is mentioned with a certain author, | |
| the author him-/herself is the copyright holder. All rights reserved. | |
| Public Documentation License Notice: | |
| The contents of this Documentation are subject to the | |
| Public Documentation License Version 1.0 (the "License"); | |
| you may only use this Documentation if you comply with | |
| the terms of this License. A copy of the License is | |
| available at http://www.openoffice.org/licenses/PDL.html | |
| The Original Documentation can be found in the CVS archives | |
| of openoffice.org at the place specified by RCSfile: in this header. | |
| The Initial Writer(s) of the Original Documentation are listed | |
| with the author-tags below. | |
| The Contributor(s) are listed with the author-tags below | |
| without the marker for being an initial author. | |
| All Rights Reserved. | |
| --> | |
| <snippet language="ooRexx" application="Writer"> | |
| <keywords> | |
| <keyword>print document</keyword> | |
| </keywords> | |
| <authors> | |
| <author id="ÅR" initial="true" email="realfsen@gmx.net" copyright="Licensed under the Apache License, Version 2.0">Åsmund Realfsen</author> | |
| </authors> | |
| <question heading="Print Existing Document">How to I print an existing document to standard printer ? | |
| </question> | |
| <answer> | |
| <listing>/* get the xComponentLoader interface */ | |
| componentLoader = UNO.createDesktop()~{%see com.sun.star.frame.XDesktop%XDesktop}~{%see com.sun.star.frame.XComponentLoader%XComponentLoader} | |
| /* start OO-Calc and open a already existing document */ | |
| fileToOpen = "file:///"directory()"/calc-print.ods" | |
| calc = componentLoader~loadComponentFromURL(fileToOpen, "_default", 0, .UNO~noProps) | |
| /* get standard printer, then print */ | |
| printer = calc~{%see com.sun.star.view.XPrintable%XPrintable} | |
| printer~print(.UNO~noProps) | |
| ::requires UNO.CLS -- load support for Open Office</listing> | |
| </answer> | |
| <versions> | |
| <version number="2.0.x" status="tested"/> | |
| <version number="1.1.x" status="untested"/> | |
| <version number="1.0.x" status="untested"/> | |
| </versions> | |
| <operating-systems> | |
| <operating-system name="All"/> | |
| </operating-systems> | |
| <changelog> | |
| </changelog> | |
| </snippet> |