Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word and OLE
Message
From
15/01/2000 15:40:39
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
15/01/2000 15:25:18
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Miscellaneous
Thread ID:
00318618
Message ID:
00318622
Views:
17
>Hi George,
>
>How do I handle this? I'm using your function, which works great. If Word is not running, it creates the object. However, if it IS running BEFORE the user runs my Application, the OBJECT doesn't get created so it sees "With OWORD" and comes up with an error. Follow me? Not sure how to handle it properly. Thanks for your help.
>
>pctitle='Microsoft Word'
>runCheck=is_run32(pctitle)
>*if runCheck=0, Microsoft Word is not running so run it
>If runCheck=0
>oword=createobject("word.application")
>Endif
>With OWord
>.documents.open(example.doc)
>endwith
>
>----ALSO, FYI Previous Problem----------
>Regarding my 'phantom' "Winword" showing up in the Task list after closing Word...I believe the problem was complicated due to issuing Visible=.f. to Word. It looks closed, but actually is not and lists the 'Winword' in the list, not "Microsoft Word". Anyway, at least for now I think I'm all set.


Mary,
As this was targeted to George I hope he doesn't mind my jumping in. GetObject() is missing there in "else" part. However if it wasn't VFP that started the word (if I do remember how is_run32 works correct) is_run32 would return it as running too. This causes one slight problem that in this case you cannot getobject(). My workaround was to check a public gHwnd for word as well. I posted that sometime ago (near new year eve) in a thread with George. If you want to check keywords I remember are "excel word IsWindow getobject word.application".
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
Previous
Reply
Map
View

Click here to load this message in the networking platform