Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BINDEVENT to MSWord?
Message
De
29/08/2003 13:32:54
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
29/08/2003 08:29:43
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00824505
Message ID:
00824629
Vues:
22
Peter,
Compiled to exe it's your local path. Doesn't matter where it's on user's box. You could also use CLSID too.
Cetin

>Hi Cetin,
>Thanks.
>One question though. Doesn't that a knowledge where word sits on the user's machine?
>Some users have it on c: some on d:, some are useing office 9 some office 10 I user office 2003?
>How would I handle that
>
>Peter
>
>
>>>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