Results 1 to 4 of 4

Thread: Printing Word app and then closing Word

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Location
    Posts
    2
    I am able to open and print the document, but when I try to close the Word app, I get the message that it is still printing.... How do I have it wait until the printing is done to close?

    This is my code, any suggestions will be greatly appreciated.

    Dim WordApp As Object
    Set WordApp = CreateObject("Word.Application")

    WordApp.Visible = False

    WordApp.Documents.Open (MyDocument)
    WordApp.ActiveDocument.Printout

    WordApp.ActiveDocument.Close
    WordApp.quit
    Set WordApp = Nothing

    Thank you for your help.

  2. #2
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655
    Ran into that before. We used a message box that said to click ok whenever the document was done printing.
    www.RealisticGraphics.net

    Running VS.Net Enterprise & VB 6

    Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML

    MSN Messenger: kmsheff

  3. #3
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    461
    The first option on the "PrintOut" command is Background. This indicates if the macro will continue while Word prints it out and is defaulted to TRUE.

    If you were to do :

    Code:
    WordApp.ActiveDocument.Printout FALSE
    I believe with this your code will not even attempt to execute the next line until printing has finished.

  4. #4

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Location
    Posts
    2
    Thank you very much for your help!!!

Posting Permissions

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



Click Here to Expand Forum to Full Width