• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 715
  • Last Modified:

Printer Spooling Check in VB

how to make sure that the printer has complete spooling the word document before closing the document / quit the word application in the VB program.

My program look like this :

dim wordapp as word.application
dim worddoc as word.document  

Set wordapp = CreateObject( "Word.Application")

set worddoc = wordapp.Documents.Open "c:\test.doc"

worddoc.PrintOut
worddoc.close
worddoc.quit
0
loywm
Asked:
loywm
  • 2
1 Solution
 
st_steveCommented:
dim wordapp as word.application
dim worddoc as word.document  

Set wordapp = CreateObject( "Word.Application")

set worddoc = wordapp.Documents.Open "c:\test.doc"

worddoc.PrintOut
doevents     'you need to wait for the printer
worddoc.close
doevents     'just in case
worddoc.quit
doevents     'just to let the VB engine finish spooling the job...then you exit
0
 
EDDYKTCommented:
Can you set printbackground flag to false before printout?


i.e.

worddoc.application.Options.PrintBackground = false
worddoc.PrintOut


I have try this yet
0
 
EDDYKTCommented:
Or

If worddoc.Application.BackgroundPrintingStatus > 0 Then
    debug.print "print jobs are queued up"
End If
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now