Application.PrintOut

S

scojerroc

I want to print many word documents, and I am getting a prompt to save after
each print. I am not trying to close the document. How can I avoid the save
prompt, which should not even come up for printing?
 
S

scojerroc

It would probably help if i poted my code, eh?

Dim recCnt As Integer, docNum As Integer
recCnt = ActiveDocument.MailMerge.DataSource.RecordCount
docNum = 1

Do Until docNum = recCnt + 1
ActiveDocument.MailMerge.ViewMailMergeFieldCodes = wdToggle
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord = docNum
.LastRecord = docNum
End With
.Execute Pause:=False
End With
Application.PrintOut
ActiveWindow.Next.Activate
docNum = docNum + 1
Loop
 
C

Cindy M.

Hi Scojerroc,
I want to print many word documents, and I am getting a prompt to save after
each print. I am not trying to close the document. How can I avoid the save
prompt, which should not even come up for printing?

What's the exact wording of the prompt you're seeing, please?

FWIW I might try assigning object variable(s) to the document's involved, rather
than using ActiveDocument. At the start of the code:
Dim mainMergeDoc as Word.Document
Set mainMergeDoc = ActiveDocument

Then substitute mainMergeDoc for ActiveDocument everywhere in your code that
refers to the main merge document (as opposed to a merge result).

After the merge executes, ActiveDocument should be the merge result, so things
could get confusing...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

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