469,568 Members | 1,490 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,568 developers. It's quick & easy.

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 3682
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by pmud | last post: by
1 post views Thread by andrew | last post: by
8 posts views Thread by Bruce_Stough | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.