|
-
Aug 18th, 2000, 06:34 AM
#1
Thread Starter
New Member
i have a richtextbox & a command button in the form.
i want to copy the data of the richtextbox to the clipboard.
i am able to do so. but when i changed the formatting of the text in the text box then the data,after copying to the clipboard,looses it's formatting in the clipboard.
i want the data should be appeared in the clipboard with formatted text.
i am waiting 4 reply............!!!!!!!!!!!!!
-
Aug 18th, 2000, 06:51 AM
#2
Guru
Are you using code to copy and paste?
In that case you should use the vbCFRTF thing. 
To copy RTF text to the Clipboard:
Code:
Call Clipboard.SetText(RichTextBox1.TextRTF, vbCFRTF)
To paste RTF text from the Clipboard:
Code:
RichTextBox1.TextRTF = Clipboard.GetText(vbCFRTF)
-
Aug 18th, 2000, 07:16 AM
#3
Thread Starter
New Member
thanx 4 reply
but i am trying to copy the text to the clipboard & then paste it in the MS word application.
will it work on the Ms word application.
-
Aug 18th, 2000, 07:28 AM
#4
-
Aug 18th, 2000, 07:29 AM
#5
Fanatic Member
Once you have copied something into the clipboard you can paste it into any program - what the receiving program does with it is another matter, but if you are copying text (with or without formatting) from a rich text box, Word should be quite happy about pasting it, since Word is just one big fat buggy rich text box anyway....
-
Aug 19th, 2000, 01:53 AM
#6
Thread Starter
New Member
yes, the problem is still here
i used the code to copy to the clipboard
Clipboard.SetText RichTextBox8.TextRTF, vbCFRTF
it works.
but when i used the code to copy to the MS word
r.Range.InsertAfter Clipboard.GetText(vbcfrtf)
{where r as document}
then what i see on the MSword is.
{\rtf1\ansi\ansicpg1252\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\fswiss MS Sans Serif;}}
{\colortbl\red0\green0\blue0;}
\deflang1033\pard\plain\f2\fs17 Ric\plain\f2\fs17\b hTextBox8
\par }
i have the text "richtextbox8" in the text box.
but when i use the "ctrl+v" to paste the text in the word then it pasted formatted text( that is what i want)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|