Automatically print with the Microsoft Document Writer

P

Paul Kotlarz

I have been trying to figure this out for a couple of weeks now and to no
avail so I'm asking for some help. Does anyone know how to get Microsofts
Document Image Writer to print automatically without putting up the "Save as"
dialog box?
My situation is this: I have an application that prints a batch of reports,
and for each page the application sends an individual print command. So if I
want these documents saved in tiff files I need to hit print a few thousand
times to accept every individual save as box. I don't need to change the
file name, as it defaults to a new file every time. Is there a way to have
the office document automatically save to the default file with out prompting?

Thanks in advance to anyone offering help.
Paul
 
B

Beth Melton

Paul Kotlarz said:
I have been trying to figure this out for a couple of weeks now and to no
avail so I'm asking for some help. Does anyone know how to get Microsofts
Document Image Writer to print automatically without putting up the "Save
as"
dialog box?
My situation is this: I have an application that prints a batch of
reports,
and for each page the application sends an individual print command. So
if I
want these documents saved in tiff files I need to hit print a few
thousand
times to accept every individual save as box. I don't need to change the
file name, as it defaults to a new file every time. Is there a way to
have
the office document automatically save to the default file with out
prompting?

Thanks in advance to anyone offering help.
Paul

You might be able to use VBA for this but I suspect it will be a little
kludgey since you would need to use SendKeys (SendKeys "{Enter}") to send
the Enter key to the Save As dialog box for the Document Image Writer to
accept the default file name. You might try recording a macro for printing
and then add the SendKeys statement at the beginning, before the Print
method. If you get stuck then you may want to post to one of the Word VBA
newsgroups for help since you'll find a wider VBA audience. You may want to
post there anyway -- someone may have a solution that's better than using
SendKeys. (I personally try to avoid using it unless absolutely necessary.)

--
~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP
https://mvp.support.microsoft.com/profile/Melton
What is a Microsoft MVP? http://mvp.support.microsoft.com/gp/mvpfaqs

Guides for the Office 2007 Interface:
http://office.microsoft.com/en-us/training/HA102295841033.aspx
 
P

Paul Kotlarz

Thanks for the idea Beth. I'm actually already doing it that way, but it's
quite kludgey as the application prints 1 page, does some processing for
10-15 seconds, then prints another page. I was really hoping to find a way
or setting or registry key that I could set that would make the doc writer
automatically print and not prompt to save at all.
 
B

Beth Melton

I think kludgey is the best you're going to get. :-( The Document Image
Writer isn't available in the Object Model and there isn't such a Registry
or application option. Another idea is to use a different solution. I've use
GhostScript for a similar situation, (i.e. creating PDF and converting the
PDFs into TIFFs) but it was extremely difficult to automate and I keep my
fingers crossed that my client never wants any changes made. LOL

~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP
https://mvp.support.microsoft.com/profile/Melton
What is a Microsoft MVP? http://mvp.support.microsoft.com/gp/mvpfaqs

Guides for the Office 2007 Interface:
http://office.microsoft.com/en-us/training/HA102295841033.aspx
 
B

Bob Buckland ?:-\)

Hi Paul,

The prompt for name is probably coming from Windows rather than Word,
You can use this macro from Word to print to the current document to the MS Office Document image writer without seeing the dialog
box. If the file already exists it increments to a new file name (adds numbers).

'============
Sub MSPaperPrint
'MS Paper is the original name of MS Office Document Imaging'
'MS Office Live Meeting Writer variant may also be an option'

Active Printer = "MS Office Document Image Writer"
Application.PrintOut OutputFilename:="<your path and default name here>"

End Sub
'==============

I'm assuming you could also pull an output name to be placed there from a text/.ini file, but you may want to also follow up in one
of the Word VBA discussion groups (link below) as I'm guessing you'll want to modify it to be more selective (i.e. print only
current page or current section).

The MS Office Document Imaging object model can set how you handle things on the receiving side
http://msdn.microsoft.com/en-us/library/aa279439(office.11).aspx
(which can also be scripted)

There are also 3rd party products that let print to TIFF (might even be able to use the MS Windows Fax capabilities as you appear to
be using greyscale TIFFs) and a number of them allow you to manipulate the output and script as well and some (for example
http://www.zan1011.com/dev.htm) or command line tools such as http://imagemagick.com that could create the file from a postscript
file, as an example, or you might consider copying from Word and then pasting to MS Office Document Imaging rather than using the
printer if you want to further manipulate the image/files.

==============
I have been trying to figure this out for a couple of weeks now and to no
avail so I'm asking for some help. Does anyone know how to get Microsofts
Document Image Writer to print automatically without putting up the "Save as"
dialog box?
My situation is this: I have an application that prints a batch of reports,
and for each page the application sends an individual print command. So if I
want these documents saved in tiff files I need to hit print a few thousand
times to accept every individual save as box. I don't need to change the
file name, as it defaults to a new file every time. Is there a way to have
the office document automatically save to the default file with out prompting?

Thanks in advance to anyone offering help.
Paul
--
Paul Kotlarz>>
--
Please let us know if this has helped,

Bob Buckland ?:)
MS Office System Products MVP

LINKS
A. Specific newsgroup/discussion group mentioned in this message:
news://msnews.microsoft.com/microsoft.public.word.programming
or via browser:
http://microsoft.com/communities/newsgroups/en-us/?dg=microsoft.public.word.programming

B. MS Office Community discussion/newsgroups via Web Browser
http://microsoft.com/office/community/en-us/default.mspx
or
Microsoft hosted newsgroups via Outlook Express/newsreader
news://msnews.microsoft.com
 
B

Beth Melton

Well what do you know, it *does* have an Object Model. I couldn't find
anything on it, thanks Bob. :)

Bob Buckland ?:-) said:
Hi Paul,

The prompt for name is probably coming from Windows rather than Word,
You can use this macro from Word to print to the current document to the
MS Office Document image writer without seeing the dialog
box. If the file already exists it increments to a new file name (adds
numbers).

'============
Sub MSPaperPrint
'MS Paper is the original name of MS Office Document Imaging'
'MS Office Live Meeting Writer variant may also be an option'

Active Printer = "MS Office Document Image Writer"
Application.PrintOut OutputFilename:="<your path and default name here>"

End Sub
'==============

I'm assuming you could also pull an output name to be placed there from a
text/.ini file, but you may want to also follow up in one
of the Word VBA discussion groups (link below) as I'm guessing you'll want
to modify it to be more selective (i.e. print only
current page or current section).

The MS Office Document Imaging object model can set how you handle things
on the receiving side
http://msdn.microsoft.com/en-us/library/aa279439(office.11).aspx
(which can also be scripted)

There are also 3rd party products that let print to TIFF (might even be
able to use the MS Windows Fax capabilities as you appear to
be using greyscale TIFFs) and a number of them allow you to manipulate the
output and script as well and some (for example
http://www.zan1011.com/dev.htm) or command line tools such as
http://imagemagick.com that could create the file from a postscript
file, as an example, or you might consider copying from Word and then
pasting to MS Office Document Imaging rather than using the
printer if you want to further manipulate the image/files.

==============
I have been trying to figure this out for a couple of weeks now and to no
avail so I'm asking for some help. Does anyone know how to get Microsofts
Document Image Writer to print automatically without putting up the "Save
as"
dialog box?
My situation is this: I have an application that prints a batch of
reports,
and for each page the application sends an individual print command. So
if I
want these documents saved in tiff files I need to hit print a few
thousand
times to accept every individual save as box. I don't need to change the
file name, as it defaults to a new file every time. Is there a way to
have
the office document automatically save to the default file with out
prompting?

Thanks in advance to anyone offering help.
Paul
--
Paul Kotlarz>>
--
Please let us know if this has helped,

Bob Buckland ?:)
MS Office System Products MVP


LINKS
A. Specific newsgroup/discussion group mentioned in this message:
news://msnews.microsoft.com/microsoft.public.word.programming
or via browser:

http://microsoft.com/communities/newsgroups/en-us/?dg=microsoft.public.word.programming

B. MS Office Community discussion/newsgroups via Web Browser
http://microsoft.com/office/community/en-us/default.mspx
or
Microsoft hosted newsgroups via Outlook Express/newsreader
news://msnews.microsoft.com

~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP
https://mvp.support.microsoft.com/profile/Melton
What is a Microsoft MVP? http://mvp.support.microsoft.com/gp/mvpfaqs

Guides for the Office 2007 Interface:
http://office.microsoft.com/en-us/training/HA102295841033.aspx
 
M

Mohan

Paul Kotlarz said:
I have been trying to figure this out for a couple of weeks now and to no
avail so I'm asking for some help. Does anyone know how to get Microsofts
Document Image Writer to print automatically without putting up the "Save as"
dialog box?
My situation is this: I have an application that prints a batch of reports,
and for each page the application sends an individual print command. So if I
want these documents saved in tiff files I need to hit print a few thousand
times to accept every individual save as box. I don't need to change the
file name, as it defaults to a new file every time. Is there a way to have
the office document automatically save to the default file with out prompting?

Thanks in advance to anyone offering help.
Paul
 
M

Mohan

Hi Paul,

I am also trying multiple ways to supress that "save as" dialog since couple
of weeks. I am wondering if you find a solution. I am trying to print all the
emails and attachments coming to particular account, basically we need to
save all of them into Tiff format, its working fine except that save as
dialog, its killing me. Could you please let me know if you got a solution.

Thanks a Bunch in advance.
Mohan
(e-mail address removed)
 

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