Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OLE Error Using Word
Message
De
01/10/2001 14:27:00
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
À
01/10/2001 14:19:57
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00562675
Message ID:
00562697
Vues:
22
>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform