Printing Word Documents from Service

  • Thread starter Richard Horrocks
  • Start date
R

Richard Horrocks

I am trying build a service that scans directories and
prints available Word documents in VB 6.0. Obviously this
requires no gui interaction at all. Currently I create the
word object using GetObject and use the following code to
open the word document
pWordApp.Application.Visible = False
pWordApp.ScreenUpdating = False
pWordApp.Application.WindowState =
wdWindowStateMinimize
pWordApp.DisplayAlerts = wdAlertsNone

pWordApp.Documents.Open fileName:=curFilePath
pWordApp.Visible = False

All fine and dandy BUT despite this on one document a pop-
up still trys to appear and locks the service. In debug I
trapped it (very difficult, it flashes on and off the
screen very fast) and it says "Now printing body
of 'docname' on 'printername' with a cancel button.
So, what am I doing wrong? why is this particular box not
surpressed? Should I take some other approach?

Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top