Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Automation of Word document inserted into a general fied
Message
From
06/04/2000 12:57:59
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
06/04/2000 12:36:57
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00356259
Message ID:
00356373
Views:
77
>>
Oscar,
>>Think :
>>oWord = CreatObject('Word.Application')
>>As :
>>oWord = thisform.myOleBoundControl
>>
>>You could createobject("Form") and add your oleboundcontrol to it. It doesn't need to be shown at all.
>>Cetin
>
>Thanks Cetin
>
>I already tried, but somehow some commands works while others don't.
>
>In my case:
>
>When assigning variable oWord like this
>
>OWord = CreateObject('Word.Application')
>
>The next two lines work Ok:
>
>oWord.selection.Bookmarks('Fecha').select
>
>oWord.selection.insertafter('MyName')
>
>
>If I assign a reference to the OLE control to the variable oWord
>
>I receive the error 'Selection' is not an object.
>
>However, if I remove the selection reference from both commands like this:
>
>oword.Bookmarks('Asignacion').select
>
>oWord.insertafter('MyName')
>
>Only the first line works fine and the second creates the next error:
>OLE 0x80020006 unknown COM state error code
>
>What am I doing wrong?



Oscar,
Selection applies to Application and (I don't remember now). Make it :
oWord.Application.selection...
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