Access / Word

  • Thread starter Thread starter Ron
  • Start date Start date
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.
 
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
 
Back
Top