open word document by office viewer

U

Uwe

Hi developers,

I have to print worddocs coming as mail attachments with the office viewer.
Is this possible via vba?

If there is word installed, my script runs well:
=====================================
' this prints with the associated application
Dim hwnd As Long
Dim ret As Long

ret = ShellExecute(hwnd, "Print", fname, "", "", 0)
=====================================
but with office viewer installed, it is not possible to use this command:
ret = 31: SE_ERR_NOASSOC
I think because the office viewer doesn't offer the possibility to print
directly (no print entry in the context menue in explorer)

With word I can also do it this way:
=====================================
Set app = createobject("Word.application")
Set docToPrint = app.documents.open(fname)
' Turn off background printing to avoid error message cf. Microsoft Technote
#Q170393
PrintBackground = app.Options.PrintBackground()
If PrintBackground = True Then app.Options.PrintBackground = False
Call docToPrint.PrintOut()
app.Options.PrintBackground = PrintBackground 'Restore PrintBackground
option
=====================================
is there a possibility to call the office viewer in the same way?

Thanks in advance for any help
Uwe
 
U

Uwe

Maybe I didn't describe it clearly enough ...

On the PCs is no MS office installed, but the microsoft word viewer 97 (+
excel viewer + ppt viewer)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top