Results 1 to 3 of 3

Thread: exit after print (wordbasic) with VB

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2002
    Location
    Turkey
    Posts
    3

    Question exit after print (wordbasic) with VB

    I am desperately seeking the solution of the problem in using FileExit in a print procedure of VisualBasic.

    A word template is used to print the data from a database. The data are inserted on the proper places of the template. If the number of the rows is more than 15 Word document is saved (FileSaveAs), closed (FileClose) and then another document is opened (FileOpen) for each 15 rows. But I cannot exit Word (FileExit). If I use it, Word prompts me that "Word is currently printing... if yes ...cancel". If I donot use it Word directly prints but Word stays open. At the end, there will be one or more open Word applications.

    How can I manage to Exit the Word after printing?
    Attached Files Attached Files

  2. #2
    Fanatic Member WorkHorse's Avatar
    Join Date
    Jul 2002
    Location
    Where you live.
    Posts
    591
    Make sure Options.PrintBackground = True then check the Application.BackgroundPrintingStatus of the Word object. Quit Word object only when BackgroundPrintingStatus = 0.

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2002
    Location
    Turkey
    Posts
    3

    Thumbs up

    Thank you very much,
    I have solved it in a very similar way that you recommended.

    objWord.ToolsOptionPrint Background:=False
    objWord.FilePrint
    objWord.FileClose
    objWord.ToolsOptionPrint Background:=True

    Actually I didnot know to use Background before the recommendation of Friend Arnout.

    Thank you again.

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