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