Access / Word

R

Ron

From an Access module I can open a Word template and
populate bookmarks from data in a recordset. This works
nicely, but results in several open documents which have
to be individually printed and closed.Is there a method
to automate printing the documents in my module? I would
like it to work similiar to opening an Access report as
acnormal.
 
D

Dave Jones

Assuming that the variable assigned to the document is
objDoc, before moving to the next record, enter the
following:
objDoc.PrintOut
objDoc.Close (wdDoNotSaveChanges)

You will have to open the template again after moving to
the next record.


When you have looped through all the records, set
objDoc=Nothing and the instance of Word to nothing.

If your instance of Word is objWord, you can use
objWord.Visible=False after initialising it so that the
user doesn't even see the template being populated and
printed.

Dave
 

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