views:

676

answers:

2

hi all:

We are doing an app to manage and print word, excel, power point and pdf files...

No application can be shown to the user when printing

to do that we find some command-line arguments that work well:

(using openoffice.org) "C:\Program Files\OpenOffice.org 3\program\soffice.exe" -norestore -nofirsts tartwizard -nologo -headless -pt MicrosoftXPSDocumentWriter doc1.doc

(using ms word) "C:\Program Files\Microsoft Office\Office\WINWORD.EXE" doc1.doc /q /n /mFilePrintDefault /mFileExit

but we just can't find any option to set the page range to print...

is it possible? another option to print those documents without show anything to the user?

thanks for reading

any ideas would be appreciated

+2  A: 

I would really rethink doing this app in Java. If the application is to manage word documents, and your interaction with word consists of assumptions that word is installed on the local machine, then java isn't adding anything to the party. .NET is likely the right way to go here (where you could easily interact with the office com objects to get what you need).

That being said, for open office, look at the open office SDK which you would have to make as part of your installer for this app.

For Microsoft Office, I would look at a Java-COM bridge (such as Jacob) to call the COM objects. If that is not an option, you could as part of your install process install a Macro into Word that you could call with the /m parameter and pass in the range values you need - but that would get very ugly very fast.

Yishai
A: 

use VBA in MS Office AP.

Benjamin