View Single Post
 
Old 12-02-2013, 05:35 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,345
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Since you're working in Access, you would need to use a macro that:
• starts a Word session;
• loads, prints & closes a document from the table;
• loop until all documents have been processed; and
• terminates the Word session.
The code for that would be something like:
Code:
Sub Demo()
Dim wdApp As Word.Application
Set wdApp = New Word.Application
Dim wdDoc As Word.Document
i As Long
wdApp.Visible = True
With TableItems
  For i = 1 To .Count
    Set wdDoc = wdApp.Documents.Open(Item(i))
    With wdDoc
      .PrintOut
      .Close False
    End With
  Next
End With
wdApp.Quit
Set wdDoc = Nothing: Set wdApp = Nothing
End Sub
where 'TableItems' refers to your Access table (I'm not familiar with Access VBA). Note that you'd also need to set a reference to the Word Object Library.

PS: Once you're confident the code is working correctly, you can change 'wdApp.Visible = True' to 'wdApp.Visible = False'.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote