Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copying text from word to VFP
Message
 
To
10/10/2002 16:32:40
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00709059
Message ID:
00710543
Views:
18
Dragan,

I got a tip from someone to do the following:
- copy the text in Word to the clipboard
- open a new Word-document
- save the new document as Rich Text
- close the file
- read the Rich Text file into memory (FileToStr)
- write the value into the memo-field

Opening and closing Word documents takes a little while but it works like a charm....
With this scenario I don´t need the rtf-control, I just need Word.

Thanks for you input on this.

Ron

>>Dragan,
>>
>>you´re right. I spoke to soon. I did this ´by hand´ where I copied text from Word into a form with the RTF-controlbox and the text showed up fine in VFP.
>>I wrote a little program to do the trick but when pasting it (_cliptext) it shows the same problem again. I know the text is present on the clipboard the way it should be but the _cliptext is not returning it properly. If I can only find a way to read the content of the clipboard....than I should be fine.....
>
>How about not using the _cliptext at all, as it contains the text version of the clipboard content? I haven't tried any of this, but I seem to remember that the rtf control has a property named RtfText or so, and then what if you just said
>
>thisform.rtfcontrol1.rtftext=oword.selection.rtftext
>
>...OK, this is a long shot, but I figure there'd be some property of oWord.Selection which would return the text in rtf format, and then just stuff it into this property.
>
>Or set focus to this control, and just do sys(1500, _medit_paste) (or whatever was the proper syntax).
>
>Just wildly guessing here, but who knows - some of this may lead to something that would eventually work.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform