Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BINDEVENT to MSWord?
Message
De
29/08/2003 08:06:42
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
29/08/2003 07:56:10
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00824505
Message ID:
00824509
Vues:
16
This message has been marked as a message which has helped to the initial question of the thread.
>Hi,
>I would like to use bindevent to let my VFP program know when the word doc it just opened for the user is closed so I can react to it
>
>Peter

Peter,
Try eventhandler instead. ie:
oWordEvents=NEWOBJECT("WordEvents")

local owrd as 'word.application'
oWrd = NewObject('word.application')
EVENTHANDLER(owrd,oWordEvents)
owrd.Documents.Add
owrd.visible = .t.
owrd.Activate


DEFINE CLASS WordEvents AS session OLEPUBLIC
	IMPLEMENTS ApplicationEvents2 IN ;
          "c:\program files\microsoft office\office\msword9.olb"
* ...
	PROCEDURE ApplicationEvents2_DocumentBeforeSave(Doc AS VARIANT, ;
             SaveAsUI AS LOGICAL, Cancel AS LOGICAL) AS VOID
* Your code here
	ENDPROC

*...
Enddefine
PS: To create 'WordEvents' code :
-Open object explorer
-Load Word type lib
-Expand events node
-Drag&drop ApplicationEvents2 node on to a code window
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform