Announcement

Collapse
No announcement yet.

Printing Word document via Excel VBA

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Printing Word document via Excel VBA



    Hi all

    I have a little problem at work that's doing my head in, and centers around printing word documents with info from Excel Document.

    The problem? I need it printing in duplex, but some printers are set to simplex. The permissions cannot be changed on the printer as other documents to it must be simplex, and from what I read when searching this site, duplex cannot be done from VBA.

    So, my next question is - can I bring up the Print Dialog box, as seen in Word, which allows the changing of this setting. At the moment, I'm using the following style of code to print it out.

    Code:
        Set wrdApp = CreateObject("Word.Application") 
        Set wrdDoc = wrdApp.Documents.Open("document.dot") 
        ...
        wrdDoc.PrintOut 
        wrdDoc.Close 
        wrdApp.Quit
    Is it possible to bring up the print dialog box? That would be the starting block I need to see if I can work around our little problem.

    I thank in advance for any advice and input.

  • #2
    Re: Printing Word document via Excel VBA

    Moved to correct forum.

    Comment


    • #3
      Re: Printing Word document via Excel VBA

      Hi sanderdolphin,

      Welcome to the OzGrid forum.

      Just come across the Word forum by chance (usually in the Excel forum). If you haven't already found the answer to this one, the code
      Code:
      wrdApp.Dialogs(wdDialogFilePrint).Display
      should display the File Print dialog box.

      Hope this helps.

      Regards,
      Batman.
      Regards,
      Batman.

      Comment


      • #4
        Re: Printing Word document via Excel VBA

        Here is an MS article HOWTO: Set Duplex Printing for Word Automation

        Cheers
        Andy

        Comment


        • #5


          Re: Printing Word document via Excel VBA

          Originally posted by Andy Pope
          Here is an MS article HOWTO: Set Duplex Printing for Word Automation
          Thanks for that link. Unfortunately, it didn't seem to work for me, which I presume is down to the fact the printers are networked with limited permissions for the user

          Originally posted by Batman
          the code
          Code:
          wrdApp.Dialogs(wdDialogFilePrint).Display
          should display the File Print dialog box.
          Many thanks, it's exactly what I wanted to do as an alternative to the document automatically printing duplex. Not brilliant, with the user having to do this each time, but better than printing single-sided.

          Many thanks both for your help.

          Comment

          Working...
          X