Alexandro Colorado wrote:

> I got a macro which prints a document:
> 
> dispatcher.executeDispatch(document, ".uno:PrintDefault", "", 0, Array())
> 
> However I was unable to find an interface for printing to a document,  
> doing some research on the reference I found the FileName which is used in  
> case of printing to a file but I couldnt find any other option to set it  
> as a PrinttoFile.

The models of all OOo documents support com.sun.star.view.XPrintable.
There you find a method "print" that allows to add parameters as
"PrintOptions".

In Basic you can write

dim args(0) as new com.sun.star.beans.PropertyValue
args(0).Name = "FileName"
args(0).Value = sFileName

ThisComponent.print(args())

Please note that "sFileName" must be a system file name, not a URL,
because it will be handed over to the printing API of the OS.

Best regards,
Mathias

-- 
Mathias Bauer - OpenOffice.org Application Framework Project Lead
Please reply to the list only, [EMAIL PROTECTED] is a spam sink.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to