By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,534 Members | 943 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,534 IT Pros & 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

P: n/a
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

Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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
Nov 20 '05 #2

P: n/a
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

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.