+ Reply to Thread
Results 1 to 4 of 4

Print word docs via Excel VBA

  1. #1
    Registered User
    Join Date
    09-05-2005
    Location
    Basingstoke, England
    MS-Off Ver
    2003
    Posts
    86

    Print word docs via Excel VBA

    Hello All,

    I have a problem which I and others here at my place of work cannot fathom out as to why it does not work. Why would a document not print out from the print dialogue box? Here is the code that I am using which does as it says, opens the document then opens the print dialogue box but will not print, that is when I hit print nothing happens.

    Please Login or Register  to view this content.


    Many thanks for your help.

    Colin
    Last edited by Ducatisto; 04-21-2010 at 08:28 AM.

  2. #2
    Registered User
    Join Date
    09-05-2005
    Location
    Basingstoke, England
    MS-Off Ver
    2003
    Posts
    86

    Re: Print word docs via Excel VBA

    The print dialogue issue is still haunting me so now I have resorted to the code below;

    Please Login or Register  to view this content.
    Whilst this does the job, once the print dialog box disappears the word document loses focus to the excel file, is there any code that will get the opened word document to retain focus after printing?

    Many thanks.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Print word docs via Excel VBA

    In the last line, you're destroying the Word instance in which the document was opened. Try deleting it.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    09-05-2005
    Location
    Basingstoke, England
    MS-Off Ver
    2003
    Posts
    86

    Re: Print word docs via Excel VBA

    Quote Originally Posted by shg View Post
    In the last line, you're destroying the Word instance in which the document was opened. Try deleting it.
    Thanks for your reply. Strangely enough that line did not 'kill' word but as it was redundant I have deleted it. The problem is still there though, it is not a showstopper but it would be nice to have the word document holding focus instead of the excel workbook that hailed it. With the code actioned the word document opens and takes focus with the print dialog box, it is only when a user interacts with the box (selecting numbers of copies or even cancelling the request) that the word document loses focus and the user then has to regain the documents focus to carry on reading it etc. Anyone know of a work round? Many thanks.

+ 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