General information
Category:
COM/DCOM and OLE Automation
>
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?
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only