>>
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,
For a sample code check "Automating Word" dated Aril 1st,2000.
Cetin