![]() |
#1
|
|||
|
|||
![]() I have an Access table that holds the paths od existing word documents. I would like to print all of these documents from Word. Is there a way to do that? |
#2
|
||||
|
||||
![]()
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 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] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Populate dropdown list with data from Access table | spw4000 | Office | 0 | 02-24-2012 05:22 AM |
Pulling email address from access table into outlook | Abacus1234 | Outlook | 0 | 11-10-2011 01:31 PM |
![]() |
b0x4it | Word VBA | 2 | 05-26-2011 06:25 AM |
Can I fill in Word document from Access table and/or query? | slim_jim_56 | Word Tables | 0 | 10-03-2007 01:59 PM |
print vba button in access causes program crash | de_la_espada | Office | 0 | 09-20-2005 04:46 AM |