+ Reply to Thread
Results 1 to 3 of 3

Using Macro in Excel

  1. #1
    Forum Contributor
    Join Date
    03-08-2007
    Location
    St. Augustine, Fl
    MS-Off Ver
    Excel 2021 for Mac
    Posts
    399

    Using Macro in Excel

    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.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525
    This could help you

    http://www.vbaexpress.com/kb/getarticle.php?kb_id=460

  3. #3
    Forum Contributor
    Join Date
    03-08-2007
    Location
    St. Augustine, Fl
    MS-Off Ver
    Excel 2021 for Mac
    Posts
    399

    Here is what I'm trying

    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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1