Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connect to the right Word instance with CREATEOBJECT()
Message
From
08/05/1998 05:06:07
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00097971
Message ID:
00097978
Views:
31
>Hi everyone,
>
>in the example below I open an embedded Word document in a Word window and then set the pagesize of it.
>
>THISFORM.Ole1.Refresh()
>THISFORM.Ole1.DoVerb(-2)
>
>oWord = GETOBJECT(,"Word.Application.8")
>WITH oWord.ActiveDocument.PageSetup
> .PageWidth = oWord.CentimetersToPoints(21)
> .PageHeight = oWord.CentimetersToPoints(29.7)
>ENDWITH
>
>How can know if the right Word instance is opened, if the user has a number of the running?
>
>Is there a better way to get hold of the instance of Word the OLE object is opened in??
Klas,
Since you have an Ole control on form you already have access to it. Do not use getobject, instead of oWord, use thisform.ole1.object.
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
Next
Reply
Map
View

Click here to load this message in the networking platform