OO-Snippets: Print Existing Document

Commons

Keywordsprint document
LanguageooRexx
ApplicationWriter
AuthorsÅsmund Realfsen (initial)
Supported Versions2.0.x  1.1.x  1.0.x  
Supported OSAll  
QuestionHow to I print an existing document to standard printer ?
Answer

Code-Snippet-Listing (snippet-source)

/* get the xComponentLoader interface */
componentLoader = UNO.createDesktop()~XDesktop~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~XPrintable
printer~print(.UNO~noProps)


::requires UNO.CLS  -- load support for Open Office

Changelog

DateUserModification

and