Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trap WORD 'Send' and 'Print'

Status
Not open for further replies.

gogins

IS-IT--Management
Sep 1, 2001
17
GB

Dear All,

After launching word.application from VFP6, is is possible
to trap (say the date) whenever either the 'Send a Copy'
or the 'Print' functions of a Word document have been
'clicked' by the user?

many thanks.
 
you'd probably need to use some event binding - EventHandler() in order to do this, and if I'm not mistaken that didn't show up until VFP7.

boyd.gif

craig1442@mchsi.com
"Whom computers would destroy, they must first drive mad." - Anon​
 

Thanks for your response Craig.

 
Gogins,

As Craig says, the EventHandler() function would do this -- it lets you trap any event in a COM server -- but it is only available in VFP 7.0 or later.

Another possibility might be to add a macro to the Word document. The macro would write the required information (such as the date) to a "hidden" part of the document. That could be a comment, or simply a piece of text formatted with the same colour as the background. Your Automation code could then search for and read that text.

From what I know of your application, your users are creating documents on the fly, so the macro could not reside in the document itself. Instead, you could put it in a template, and your Automation code could then ensure that all new documents are based on that template. I can't give you much more information, because I'm not a Word macro expert, but I hope this will get you started.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top