View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nick Hodge Nick Hodge is offline
external usenet poster
 
Posts: 1,173
Default printing an external document

Steve

This automates Word from Excel and uses early binding, so you would need to
set a reference to the MS Word library under references... in the VBE
(Alt+F11) before running the code

Sub AutomateWord()
Dim wdApp As Word.Application
Dim wdDoc As Word.Document
Set wdApp = New Word.Application
Set wdDoc = wdApp.Documents.Open("C:\FaxCover.doc")
wdDoc.PrintOut
wdDoc.Close SaveChanges:=False
Set wdDoc = Nothing
wdApp.Quit
Set wdApp = Nothing
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
www.nickhodge.co.uk


"Steve" wrote in message
...
I am using a VBA control - Command button. and I would like to be able to
print a word document by pressing it. The file is a fax cover sheet, which
is
an important part of the application I am making.

Is there anyway this can be achieved.

Thank you to all who are able to help