Can I make a Macro to print a word file from an Excel File.
Thanks,
Skip
Can I make a Macro to print a word file from an Excel File.
Thanks,
Skip
Last edited by Wskip49; 03-08-2007 at 10:47 AM.
This could help you
http://www.vbaexpress.com/kb/getarticle.php?kb_id=460
Sub PrintWordDoc()
Dim oWord As Object
Dim sPath As String
Dim iCnt As Integer
'Path to Cover.doc in same folder as workbook
sPath = ThisWorkbook.Path & Application.PathSeparator & "Cover.doc"
'Ask copy count
iCnt = Val(InputBox("How many copies", "Print Word doc", 1))
'If any
If iCnt >= 1 Then
'Create word application
Set oWord = CreateObject(Class:="Word.Application")
'Open document sPath en printout wanted copies
With oWord.Documents.Open("Bradley's Word File Stuff\MasterCookRecipes8-05.doc.page2")
.PrintOut Background:=False, Copies:=iCnt
.Close False
End With
'Quit word application
oWord.Quit False
End If
'Clean up
Set oWord = Nothing
End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks