473,396 Members | 1,797 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,396 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 4595
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.