473,233 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,233 software developers and data experts.

Copy Richtextbox Data in clip board and pasting On Excel

Hi
I m worki on clip board m trying to copy RTF data(Text+Image) both txt and image on clip board its only pasting text On Excel not the image can any one help me in this regard
I m using your artical
http://www.thescripts.com/forum/thread356836.html
but hasnt workfor me

Const CF_ENHMETAFILE As Integer = 14
Dim henmetafile As IntPtr
Dim metaFile As Imaging.Metafile

If ClipboardAPI.OpenClipboard(Me.Handle) Then
If ClipboardAPI.IsClipboardFormatAvailable(CF_ENHMETA FILE) <> 0 Then
henmetafile = ClipboardAPI.SetClipboardData(CF_ENHMETAFILE, henmetafile)
metaFile = New Imaging.Metafile(henmetafile, True)
ClipboardAPI.CloseClipboard()
nd If
End If
Jun 13 '07 #1
3 4587
shweta123
692 Expert 512MB
Hi,

Please refer this Link



Hi
I m worki on clip board m trying to copy RTF data(Text+Image) both txt and image on clip board its only pasting text On Excel not the image can any one help me in this regard
I m using your artical
http://www.thescripts.com/forum/thread356836.html
but hasnt workfor me

Const CF_ENHMETAFILE As Integer = 14
Dim henmetafile As IntPtr
Dim metaFile As Imaging.Metafile

If ClipboardAPI.OpenClipboard(Me.Handle) Then
If ClipboardAPI.IsClipboardFormatAvailable(CF_ENHMETA FILE) <> 0 Then
henmetafile = ClipboardAPI.SetClipboardData(CF_ENHMETAFILE, henmetafile)
metaFile = New Imaging.Metafile(henmetafile, True)
ClipboardAPI.CloseClipboard()
nd If
End If
Jun 13 '07 #2
Plater
7,872 Expert 4TB
Well, this worked pasting into ms-word just fine but not excel
Expand|Select|Wrap|Line Numbers
  1. RichTextBox rtb = new RichTextBox();
  2. rtb.SelectionBackColor = Color.Red;
  3. rtb.AppendText("hi there, all this text will be background color red");
  4. Clipboard.SetText(rtb.Rtf, TextDataFormat.Rtf);
  5.  
But from there I could select it in ms-word and paste it into excel....
Jun 13 '07 #3
Thankz For Reply
yes u r rite but i want paste image and text (like If thre is an image after some
text i want to copy both txt and image in Excel) Clipboard treat Data as EnhanceMeta Format so how i wll do this can u give me any sample for doing that?
Jun 14 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Rhona Gallogly | last post by:
After updating to XP our users are experiencing problems with the copy facility from access to excel. If you set the 'Number stores as text' off in excel then the numbers 'appear' on excel to be...
1
by: Mamatha | last post by:
Hi I have some items in listview. I want to copy the selected items from listview using the clip board mechanism in VB.NET. I used this code but it was not copied. For Each lsvrow As...
0
by: Steven | last post by:
Hi All, Is there any method to copy the MSFlexGrid data (including the text color, cell background color etc) to the microsoft excel work sheet? By using the clipboard function, I can read the...
0
by: an.sally | last post by:
Hi, I saw in a online banking application, they have a tree that holds balance statement for each day of the month. when you click on a node, the balance data of that day is shown in a grid. The...
2
by: veera372 | last post by:
hi this is veera, i wants to copy a data from an excel and paste it into a data grid in the web form (asp .net) by clicking the button paste... i think it can be done in java script using clipboard...
0
by: atif283 | last post by:
Hi I m working on clip board application in vb.net and i need to paste file on window's desktop how i will do it can any one help me in this regard? Thankz in advance
1
dmjpro
by: dmjpro | last post by:
could anyone tell me how can i access the clip board using JS???? plz help. kind regards. dmjpro.
4
by: SirCodesALot | last post by:
hi all, I am trying to copy the contents of a div to the clip board the same way that Microsoft copies it when you select the contents with the mouse and select copy. However, something is not...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.