Print macro using Microsoft Office Document Image Writer

T

tobnull

I am using Word 2003 on Windows XP Pro.

I need to set up a print macro that prints a template to Microsoft
Office Document Image Writer.

I got the macro set up to engage the printer but not sure how to
proceed on the following steps:

1. I need Microsoft Office Document Image Writer to open

2. then you have to select one of 6 file names

3. save as one of those names then it is saved as a .tiff image

4. then need the printer to reset back to default printer for regular
printing.

I have step one down but unsure how to proceed on the next three
steps.
Any suggestion on the next steps or where I could find documentation to
assist me would be appreciated.
 
G

Graham Mayor

The document image writer is covered at
http://www.gmayor.com/pdf_to_word.htm

Essentially the following will print to the image writer then reset the
printer

Sub PrintMODI()
Dim sPrinter As String
sPrinter = ActivePrinter
ActivePrinter = "Microsoft Office Document Image Writer"
Application.PrintOut
ActivePrinter = sPrinter
End Sub

Insert the filename at the prompt or accept the default

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
T

tobnull

Well this works in getting the document image writer to do what I want,
however it does not reset to default printer but instead changes
default printer to document image writer.

I tried various ways of rewriting the macro but am not having any
success.

Should have added this info, my computer is on a network with an
assigned printer out of a list on the floor which I work.

Tried adding the printer name to the macro but does not seem to work.
Took out the final step, added an extra step but none of my current
ideas work, most want me to debug the macro or do nothing.

Suggestions on this final stage of the macro should go to return to the
assigned printer?
 
G

Graham Mayor

The macro as written should return the printer setting as it was when the
macro was run. If you want a more belt and braces approach

Sub PrintMODI()
Dim sCurrentPrinter As String
On Cancel GoTo Cancelled:
sCurrentPrinter = ActivePrinter
ActivePrinter = "Microsoft Office Document Image Writer"
Application.PrintOut FileName:=""
Cancelled:
With Dialogs(wdDialogFilePrintSetup)
.Printer = sCurrentPrinter
.DoNotSetAsSysDefault = False
.Execute
End With
End Sub

See http://www.gmayor.com/fax_from_word.htm
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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