Craig Johnson wrote:

I have a set of sheets in a spreadsheet doc that contain data plots that I want to print to a file where the file name is based on the sheet name.

The print ranges for each sheet have been set such that only the plots will be printed.

I have For loop that does...

For i = Lbound(SheetNames()) To Ubound(SheetNames())

    <update sheet data and plot data range to include new sheet data>

    PrintChart(SheetNames(i))
Next i

Right now the PrintChart routine simply does ThisComponent.Print(Array())
and I get the plots printed on paper from my printer.

I would like to have it do a 'print to file' with the file name set to something like /the/path/to/<SheetName>.ps but I can't figure out how to specify the 'print to file' option and the file path name.

Anyone have any hints on how to do this?

Thanks
Craig Johnson

To answer my own question...

dim filename as string
filename = "/the/path/to/myChart.ps"

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

ThisComponent.print(args())

Craig Johnson

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

Reply via email to