Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Put text into clipboard to be fixed font when pasted.
Message
From
13/06/2008 17:25:13
 
 
To
13/06/2008 13:07:41
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01243628
Message ID:
01324007
Views:
33
Dragan --

My original reason for this thread was to take some text that was displayed in an edit box in fixed font and be able to paste into elsewhere (Word, for instance) where the fixed font would be maintained.

Now, using the RTF control, I can see how to get the value -- but still don't know how to put into the clipboard. _cliptext is obviously just the text itself ...

(BTW, the user can see this text, but the object can't ever get the focus, so the user can't simply do Ctrl+A then Ctrl+C themselves.)

Jim

>>Dragan ---
>>
>>Have not worked with RTF's before ...
>>
>>OK, so I've finally been able to find the RTFBox from c:\windows\system32\richtx32.ocx
>>
>>I don't see a copy method. when I look at its property sheet.
>>
>>What am I missing?
>
>Sorry, I was wrong - no such method. The RtfBox has many things to facilitate clipboard-like operation, a whole set of sel* properties which you can use. To copy the whole text, you'd actually have to use its .textRtf property. To select a piece of it, you'd have to manipulate the .selstart and .sellength properties, or to rely on .Find() method, which makes the found string selected.
>
>You can search for the string yourself, but you may be off by one - I've just created a form, added a rtf box to it, pasted the paragraph before this into it, and
>
>
ortf.Find("to select")
>?ortf.seltext
>To select
>?ortf.selstart
>193
>?ATC("to select",ortf.text)
>194
>?ATC("to select",ortf.textrtf)
>288
>
>
>so beware if you intend to clip stuff - RTF box, being an ActiveX, may have its own interpretation of what .selstart means.
>
>Also, practically all the .sel* properties are read-write at runtime; .selAlignment, .selBold, .selIndent etc can be manipulated programmatically.
Jim Nelson
Newbury Park, CA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform