Problem while Opening Two Word Applications?

A

Ahmad

hi!

I have problem while Opening and closing another Word Application when
there is already a Word Application Running. I have created a toolbar
using VBA to do some stuf. Toobar has a button named "Print to PS" to
convert the current document to PostScript. The steps i follow are as
under.

1. Open Word document Test.doc.
2. Edit it and save.
3. Click "Print to PS" button.

Now "Print to PS" does following things:

Create a Copy of Test.doc on some other location like "C:\Documents And
Settings\Administrator\LocalSettings\Temp\Temp.doc".
Create an other process in which it Initializes the Word application
using Word's Object Model. Open Temp.doc in Invisible Mode, and Print
Temp.doc to PostScript.
Close Document and then Quit the Word Application and return control.

That's the whole scenario. Now the Problem is that when "Print to PS"
try to close the Word after Printing.It gives a message box that "The
file is in use by another application or user C:\Documents and
Settings\...\Normal.dot". when i press Ok it shows a save as dialog box
to save Normal.dot. I don't want this to be shown to the user.

Any Suggestions.

Regards,

Ahmad Jalil Qarshi
 
A

Ahmad

Thanks Jezebel!

you are always there to help.

Actually i cann't do that. Its basic reason is that handler function of
"Print to PS" Button not only print the document to PostScript but also
do some manipulation on the Printed .ps file. So when i run my
application in debug mode and when i call PrintOut(......) function in
my handler function. I can see my Printing Job in print spooler. Its
staus in spooler is printing and under the "Pages" i can see "N/A" at
that moment. And there is no printing started at all. when complete
debuging is done and i came out of debug mode i can see that now
printer start printing,Means Word may be just sends printing job to the
spooler but not actually send print stream. So i cann't do manipulation
over .ps file after PrintOut function.

That's the main reason for doing this.

Thanks.

Ahmad Jalil Qarshi
 
J

Jezebel

I think there must be something else going on with your code. I've not had
any trouble running the Acrobat functions from within VBA. What version of
Acrobat are yuou using?
 

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