opening a word document for printing in access

  • Thread starter Thread starter vicsalt
  • Start date Start date
V

vicsalt

i have links to word documents which obviously opens word and the document.
all i want to do is print the word document. is there a easyier way
 
Public Sub PrintWordDoc(ByVal DocName As String)

Dim objApp As Object
Dim objDoc As Object

Set objApp = CreateObject("Word.Application")
Set objDoc = objApp.Documents.Open(DocName)
objDoc.PrintOut
objDoc.Close
Set objDoc = Nothing
Set objApp = Nothing

End Sub

Example of use ...

PrintWordDoc "c:\usenet\test.doc"
 
Sorry more help needed Ive not used code before


Brendan Reynolds said:
Public Sub PrintWordDoc(ByVal DocName As String)

Dim objApp As Object
Dim objDoc As Object

Set objApp = CreateObject("Word.Application")
Set objDoc = objApp.Documents.Open(DocName)
objDoc.PrintOut
objDoc.Close
Set objDoc = Nothing
Set objApp = Nothing

End Sub

Example of use ...

PrintWordDoc "c:\usenet\test.doc"
 

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

Back
Top