Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OLE Error Using Word
Message
From
01/10/2001 14:27:00
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
 
To
01/10/2001 14:19:57
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00562675
Message ID:
00562697
Views:
20
>>I'm getting an OLE error
>>
>>OLE error code 0x80020006: Unknown name.
>>
>>on the last line of the code below:
>>
>>
>>cSource = 'This is a test'
>>oWord = CREATEOBJECT("Word.Application")     && Open Word
>>oWord.WindowState = 2                        && Minimized
>>_ClipText = ""                               && Clear Clipboard
>>_ClipText = cSource
>>oWord.Documents.Add.cSource.Paste          && Paste into new word doc
>>
>>
>>What is wrong and where can I find information on the correct commands/syntax for OLE calls? Thanks!
>>
>>Regards, Renoir
>
>You need to first add the document and then paste the clipboard contents:
>
oWord.Documents.Add()
>oWord.ActiveDocument.Range.Paste
>This will paste to where the cursor is located, in this case at the beginning of the document. You can also supply parameters to the Range object to paste into a different portion of the doc. The info for the word object model is at your office ..\Office\vbawrd8.hlp for Word97 and in ..\Office\1033\ for Word 2000 (don't have the file name handy).
>HTH

That was it! Thanks!

Renoir
Previous
Reply
Map
View

Click here to load this message in the networking platform