Consulting

Results 1 to 5 of 5

Thread: Sleeper: Simple Print Word doc from Excel

  1. #1
    Site Admin
    The Princess
    VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location

    Sleeper: Simple Print Word doc from Excel

    On click of a button in Excel, I want a dialog/msgbox to pop up asking how many copies they would like to print, and it prints that many copies of a specific Word document that resides in the SAME folder as the Excel file. We can call the Word doc "cover.doc".

    Anybody?
    ~Anne Troy

  2. #2
    Administrator
    VP-Knowledge Base VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hi Princess,

    Something like:

    Sub PrintWordDoc()
    Dim oWord As Object
    Dim sPath As String
    Dim iCnt As Integer
    sPath = ThisWorkbook.Path & Application.PathSeparator & "Cover.doc"
    iCnt = Val(InputBox("How many copies", "Print Word doc", 1))
    If iCnt >= 1 Then
    Set oWord = CreateObject(Class:="Word.Application")
    With oWord.Documents.Open(sPath)
    .PrintOut Background:=False, Copies:=iCnt
    .Close False
    End With
    oWord.Quit False
    End If
    Set oWord = Nothing
    End Sub

    Enjoy!
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  3. #3
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hi Anne,

    Did this work for you?
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  4. #4
    Site Admin
    The Princess
    VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    Well, of course something else came up, but I will try it VERY soon!
    ~Anne Troy

  5. #5
    Administrator
    VP-Knowledge Base VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hi Princess,

    Ah..ok..hope it works for yah...
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

Posting Permissions

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