Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RTF Cut, Copy, Paste

Status
Not open for further replies.

MattSTech

Programmer
Apr 10, 2003
333
US
Someone please save me from myself.
Problem:
RTB ctrl+x,c,p work perfectly but my mnu cut,copy,paste procedures do not.

I have seen this stuff on the forum but not exactly what I want. The RTB is a code editor (highlights certain words) and I need pasted data to colorize or stay colorized once copied to the clipboard.

Limited success was achieved by using the clipboard.gettext(vbCFRTF) but this only works with text copied from the ctrl+C,X. here is the cut copy paste code.

Sub EditCopyProc()

Clipboard.Clear
Clipboard.SetText Screen.ActiveControl.SelText, vbCFRTF

End Sub

Sub EditCutProc()

Clipboard.Clear
Clipboard.SetText Screen.ActiveControl.SelText, vbCFRTF
Screen.ActiveControl.SelText = ""

End Sub

Sub EditPasteProc()

Screen.ActiveControl.SelText = UCase(Clipboard.GetText(vbCFRTF))

End Sub

I have done a little work with the API but ran into problems. Any fix for this will be appreciated. If you can tell me how to format the text copied from other apps such as word into my format as well (as for colorization of certain words, Font, Fontsize) it would be great but if I can just get it to cut copy and paste within my app then I will be grateful.


Thanks,

Matt

 
Excellent, Thanks! Just what I needed.

How about forcing uppercase to the ctrl+v text from another application. My current pasteProc uses UCASE(clipboard.gettext(vbcfrtf))
Thanks again

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top