VBScript adding functions/macros to Word

G

Gemma M

Hi,

Can VBScript add a function/macro to Word?

I have a VBScript which opens launches Word, opens a document, removes "Save
As...", menu option, and presents it to the user. The user, when finished,
closes Word.

The problem I have is that if the user prints the document, Word asks them
to save it, because the last-printed date is changed. However, they don't
understand why they are being asked to save a document they haven't changed.

So, I would like to alter what sits behind print, to do a print-and-save
operation.

I cannot have a macro existing in the document or document template, I have
no control of their contents before they come within the control of my
script, hence my wanting to add the function/macro after launching word and
opening the document in question.

Gem
 
J

Jonathan West

All you need do is after the print set the Saved property of the document to
True. That will stop Word asking to save after printing
 
G

Gemma M

This cannot be done. VBScript launches Word and hands control to the user
(fire and forget). So, the script starting Word off, needs to be able to
hijack the print facility while it still has control, before surrendering it
to the user.
 
J

Jonathan West

Gemma M said:
This cannot be done. VBScript launches Word and hands control to the user
(fire and forget). So, the script starting Word off, needs to be able to
hijack the print facility while it still has control, before surrendering
it to the user.

It can be done. Show us the relevant part of the code that you are using,
and I'll show you how to fix it.
 

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