Hi Cetin, thanks a lot for the advise.
How could I paste into a already opened Word/Excel where the last cursor
position was? As your code will always open a new document/sheet, then paste.
Thanks in advance.
>>I need to copy a field from a table and paste it into either Word
>>or Excel document being opened.
>>
>>I used _CLIPTEXT = ALLTRIM(table.field) to copy into memory.
>>How could I paste it "automatically" on where the last cursor being
>>placed on the Word/Excel document? Could anyone share with me on the
>>links needed and the syntax to paste, please. Thank you very much.
>
_cliptext = "testpaste"
>oExcel = createobject("Excel.application")
>WITH oExcel
> .workbooks.add
> WITH .activeworkbook
> .activesheet.paste
> ENDWITH
> .visible = .t.
>ENDWITH
>
>oWord = createobject("Word.application")
>WITH oWord
> .documents.add
> .selection.paste
> .visible = .t.
>ENDWITH
Cetin