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
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