473,387 Members | 1,464 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,387 software developers and data experts.

Using VB.Net or C#, utilizing the clipboard object, how to copy an MS Excel graphic from the clipboard to an image control and obtain its source reference

TC
Hello,

Here is what I'm trying to do:

-- Make sure both MS Excel and MS Word are running
-- Create an Excel chart
-- Save the Excel file
-- Copy the Excel chart onto the clipboard using Ctrl + C
-- Go to Word and look under Edit > Paste Special
-- Note there is a source reference and an option to paste the chart as a
metafile, etc.
-- I would like to take this same information and make it available in a C#
or VB.Net app

For example, create a simple Windows application with a userform, an image
control, a label and a single command button.

Let's say that after the Excel chart is on the clipboard, one clicks the
Windows application command button and Voila!, the imate control now
contains a copy of the Excel chart and the label contains the reference
information.

I can make this work utilizing older technologies (i.e. WIN API to access
the clipboard, etc.).

Currently, when I try to set the image control in C#, I get a "cannot
implicitly convert ..." blah blah error. Don't even know where to begin to
obtain the source reference.

Either I do not understand the currently available clipboard functionality
under .Net or this is still only possible via the WIN API.

Any assistance would be appreciated.

Best Regards,

Todd

Jul 21 '05 #1
5 3999
Hi TC,

Keep in mind that it is not important for dotNet how it is set on the
clipboard the only thing that is important what object is on the clipboard.

Here some links that should answer all your questions.

http://msdn.microsoft.com/library/de...ardSupport.asp

http://msdn.microsoft.com/library/de...mpdragdrop.asp

I hope this helps a little bit?

Cor
Jul 21 '05 #2
TC
Hey Cor & Other Folks,

OK, let me clarify a bit here.

Using the WIN32 API, there is a clipboard format called "OwnerLink".
Similarly to the .Net clipboard, one would register this format, check for
it on the clipboard and then retrieve using several API calls.

There are also clipboard formats called "Link Descriptor" and "Object
Descriptor" under WIN32.

I guess it fair to say that, under .Net, there are currently no methods or
properties available to extract a source reference when a user places an
Office object / graphic on the clipboard.

If there is a workaround, by all means, please share.

Best Regards,

Todd

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:eB****************@TK2MSFTNGP09.phx.gbl...
Hi TC,

Keep in mind that it is not important for dotNet how it is set on the
clipboard the only thing that is important what object is on the clipboard.
Here some links that should answer all your questions.

http://msdn.microsoft.com/library/de...ardSupport.asp
http://msdn.microsoft.com/library/de...mpdragdrop.asp
I hope this helps a little bit?

Cor

Jul 21 '05 #3
Hi Todd,

A class named ClipBoard is present in the namespace System.Windows.Forms. This class has only 2 methods - to set and get the content to and from ClipBoard. The Get method returns an IDataObject interface that has methods to identify the format of the clip board content, but not the reference information you needed.

Regards,--
Girish Kumar
ICICI Infotech
"TC" wrote:
Hey Cor & Other Folks,

OK, let me clarify a bit here.

Using the WIN32 API, there is a clipboard format called "OwnerLink".
Similarly to the .Net clipboard, one would register this format, check for
it on the clipboard and then retrieve using several API calls.

There are also clipboard formats called "Link Descriptor" and "Object
Descriptor" under WIN32.

I guess it fair to say that, under .Net, there are currently no methods or
properties available to extract a source reference when a user places an
Office object / graphic on the clipboard.

If there is a workaround, by all means, please share.

Best Regards,

Todd

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:eB****************@TK2MSFTNGP09.phx.gbl...
Hi TC,

Keep in mind that it is not important for dotNet how it is set on the
clipboard the only thing that is important what object is on the

clipboard.

Here some links that should answer all your questions.

http://msdn.microsoft.com/library/de...ardSupport.asp

http://msdn.microsoft.com/library/de...mpdragdrop.asp

I hope this helps a little bit?

Cor


Jul 21 '05 #4
TC
Hey Girish,

Sorry for the delayed response.

I just wanted to thank you for the first very clear and direct answer to
this question.

Best Regards,

Todd

"GirishKumar" <Gi*********@discussions.microsoft.com> wrote in message
news:07**********************************@microsof t.com...
Hi Todd,

A class named ClipBoard is present in the namespace System.Windows.Forms. This class has only 2 methods - to set and get the content to and from
ClipBoard. The Get method returns an IDataObject interface that has methods
to identify the format of the clip board content, but not the reference
information you needed.
Regards,--
Girish Kumar
ICICI Infotech
"TC" wrote:
Hey Cor & Other Folks,

OK, let me clarify a bit here.

Using the WIN32 API, there is a clipboard format called "OwnerLink".
Similarly to the .Net clipboard, one would register this format, check for
it on the clipboard and then retrieve using several API calls.

There are also clipboard formats called "Link Descriptor" and "Object
Descriptor" under WIN32.

I guess it fair to say that, under .Net, there are currently no methods or properties available to extract a source reference when a user places an
Office object / graphic on the clipboard.

If there is a workaround, by all means, please share.

Best Regards,

Todd

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:eB****************@TK2MSFTNGP09.phx.gbl...
Hi TC,

Keep in mind that it is not important for dotNet how it is set on the
clipboard the only thing that is important what object is on the

clipboard.

Here some links that should answer all your questions.

http://msdn.microsoft.com/library/de...ardSupport.asp

http://msdn.microsoft.com/library/de...mpdragdrop.asp

I hope this helps a little bit?

Cor


Jul 21 '05 #5
Hi Todd,

It's nice to hear from you.

Regards,
Girish Kumar

"TC" wrote:
Hey Girish,

Sorry for the delayed response.

I just wanted to thank you for the first very clear and direct answer to
this question.

Best Regards,

Todd

"GirishKumar" <Gi*********@discussions.microsoft.com> wrote in message
news:07**********************************@microsof t.com...
Hi Todd,

A class named ClipBoard is present in the namespace System.Windows.Forms.

This class has only 2 methods - to set and get the content to and from
ClipBoard. The Get method returns an IDataObject interface that has methods
to identify the format of the clip board content, but not the reference
information you needed.

Regards,--
Girish Kumar
ICICI Infotech
"TC" wrote:
Hey Cor & Other Folks,

OK, let me clarify a bit here.

Using the WIN32 API, there is a clipboard format called "OwnerLink".
Similarly to the .Net clipboard, one would register this format, check for it on the clipboard and then retrieve using several API calls.

There are also clipboard formats called "Link Descriptor" and "Object
Descriptor" under WIN32.

I guess it fair to say that, under .Net, there are currently no methods or properties available to extract a source reference when a user places an
Office object / graphic on the clipboard.

If there is a workaround, by all means, please share.

Best Regards,

Todd

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:eB****************@TK2MSFTNGP09.phx.gbl...
> Hi TC,
>
> Keep in mind that it is not important for dotNet how it is set on the
> clipboard the only thing that is important what object is on the
clipboard.
>
> Here some links that should answer all your questions.
>
>
http://msdn.microsoft.com/library/de...ardSupport.asp >
>
http://msdn.microsoft.com/library/de...mpdragdrop.asp >
> I hope this helps a little bit?
>
> Cor
>
>


Jul 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Stan | last post by:
In the old days of VB6, an Excel chart image could be pasted into a picture box with Clipboard using the following commands. xlApp.ActiveChart.ChartArea.Copy Picture1.Picture =...
1
by: barma16 | last post by:
I've hit a bit of a brick wall here, and could use some advice. I have an Access application whose output is a four-tab Excel spreadsheet where three of the four tabs are the result of database...
7
by: TC | last post by:
Hello, I am familiar with obtaining source file reference material from the system clipboard using the old Win32 API. For example, copy an Excel chart onto the clipboard and goto Word. Under,...
2
by: TC | last post by:
Hello, Here is what I'm trying to do: -- Make sure both MS Excel and MS Word are running -- Create an Excel chart -- Save the Excel file -- Copy the Excel chart onto the clipboard using Ctrl...
14
by: pmud | last post by:
Hi, I need to use an Excel Sheet in ASP.NET application so that the users can enter (copy, paste ) large number of rows in this Excel Sheet. Also, Whatever the USER ENETRS needs to go to the...
1
by: andrew | last post by:
I have a MSchart object (COM Component) which I wish to insert as an image into a picture box so that I can print it out. 'I call the chart controls's EditCopy to pass data to the clipboard. ...
1
by: ray well | last post by:
hi, i need to give the user the ability to extract a rectangular area of their choice from a graphic displayed in a picture box to the clipboard, so they can use it elsewhere. say the graphic...
53
by: Hexman | last post by:
Hello All, I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm using some VB6 code, .Net2003 code,...
8
by: Bruce_Stough | last post by:
I am currently using Control.DoDragDrop to drop a text string into Excel. I use the following code DataObject dd = new DataObject();...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.