What version of Word are you using? I vaguely recall an earlier thread where someone pointed out that there was a bug or problem using Word97. If this is the case and you have access to an earlier version of Word, try your code there.
I'm sure you already know, but I'll confirm the fact that there is nothing wrong with your syntax. I cut and pasted each line from your message into VFP 5 and had no problem.
>the '=' is no longer necessary in VFP 5.0
>
>
>>Try using
>>
>>=oleobj.filenew()
>>
>>The important part is the equal sign.
>>
>>Joe
>>
>>>Hi
>>>
>>>
>>>I am executing some OLE statements in order to produce a Word
>>>Document from VFP 5.0 Prof.
>>>
>>>Word version is 7.0 (Office 95) + Windows 95.
>>>
>>>Statements are like this:
>>>
>>>oleobj = createobject("word.basic")
>>>
>>>oleobj.filenew
>>>
>>>oleobj.insert("Any Text" + table.field)
>>>
>>>oleobj.fileclose
>>>
>>>oleobj.filequit
>>>
>>>etc.
>>>
>>>
>>>Any statement after "createobject" generates this error message:
>>>
>>>OLE Error 0x80020006 (Error Number 1426).
>>>
>>>Please, Does anyone know about this? What is the problem?
>>>
>>>Thanks
>>>
>>>Juan Carlos
Colin Magee
Team Leader, Systems Development
Metroland Media Group Ltd.
Mississauga, Ontario, Canada
cmagee@metroland.comNever mistake having a career with having a life.