Loading
Ozgrid Excel Help & Best Practices Forums

Excel Video Tutorials / Excel Dashboards Reports



Results 1 to 5 of 5

Thread: Printing Word document via Excel VBA

  1. #1
    Join Date
    18th May 2006
    Posts
    3

    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.

    VB:
    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.

    Excel Video Tutorials / Excel Dashboards Reports


  2. #2
    Join Date
    24th January 2003
    Location
    Australia
    Posts
    31,708

  3. #3
    Join Date
    8th September 2004
    Location
    Northampton, England
    Posts
    2,601

    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
    VB:
    wrdApp.Dialogs(wdDialogFilePrint).Display 
    
    
    should display the File Print dialog box.

    Hope this helps.

    Regards,
    Batman.

    Excel Video Tutorials / Excel Dashboards Reports


  4. #4
    Join Date
    7th March 2003
    Location
    Essex, England
    Posts
    11,314

    Re: Printing Word document via Excel VBA

    Cheers
    Andy


  5. #5
    Join Date
    18th May 2006
    Posts
    3

    Re: Printing Word document via Excel VBA

    Quote 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

    Quote Originally Posted by Batman
    the code
    VB:
    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.

    Excel Video Tutorials / Excel Dashboards Reports


Thread Information

Users Browsing this Thread

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

Possible Answers

  1. Creating a Word Document with Excel VBA
    By webbdk in forum EXCEL HELP
    Replies: 5
    Last Post: July 3rd, 2014, 16:11
  2. Copy Word document into Excel VBA
    By Choppork in forum Excel and/or Word Help
    Replies: 1
    Last Post: August 6th, 2008, 07:26
  3. Printing a Word document with a macro
    By Alec H in forum EXCEL HELP
    Replies: 2
    Last Post: February 23rd, 2006, 20:42
  4. Replies: 1
    Last Post: June 30th, 2003, 03:15

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
  •  
porno