473,791 Members | 2,985 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Copy OLE object from Clipboard

Hi, all.

Here's the scenario: I embedd a .txt file in Word as OLE object,
then I copy it (manually), so now it's on the clipboard. How do I
programatically (in C#) get that OLE object file from the clipboard
and dump it into an actual text file on the file system? All I would
like to know is how to grab the OLE from the clipboard and transform
it into a file, stream, string, or anything that gives me the internal
contents of that txt file.

Thanks in advance,

Mar 3 '07 #1
1 4211
Hello Ludwig,
Here's the scenario: I embedd a .txt file in Word as OLE object,
then I copy it (manually), so now it's on the clipboard. How do I
programaticall y (in C#) get that OLE object file from the clipboard
and dump it into an actual text file on the file system? All I would
like to know is how to grab the OLE from the clipboard and transform
it into a file, stream, string, or anything that gives me the internal
contents of that txt file.
I think you'll have to use the OLE interfaces to do this - IDataObject
seems to come to mind. With this type of content, the statement "[the file
is] now on the clipboard" is not correct, as the clipboard only contains
information about the file, not the file itself. To get to the actual
content in a certain representation, you have to communication with the
application that's the source of the clipboard operation, and to do that
you have to use the OLE interfaces.

I'm not aware of any existing .NET code to help you, but you may well find
some on sites like CodeProject. Otherwise dig out a copy of Inside OLE 2
and hack away... <g>
Oliver Sturm
--
http://www.sturmnet.org/blog
Mar 4 '07 #2

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

Similar topics

0
1258
by: pcouas | last post by:
Hi, What is best way to Copy object that extend TagSupport ? Regards Philippe
2
3706
by: cv | last post by:
Hi all, How do I copy from clipboard to any control of my page? Any help wud be appreciated. TIA, cv
1
2713
by: Manuel | last post by:
hello everyone in my website i use the methods ".execCommand('SelectAll')" and ".execCommand('Copy')" to copy a defined area to the clipboard, that works fine, but now i wanted to make my website compatible with macintosh. the same functions dont work on a mac, so i am asking if anyone knows how the "copy to clipboard" function (for text and images!) works on macintosh or if it works at all on a mac.
3
2146
by: Jean-Luc ERNST | last post by:
Hello, I apologize for my english, I'm french speaking... Could someone help me to finalize a little project? I'm writing a form for my site but I'don't know many in Javascript (I'm a newbee). When the form is completed, the visitor may display it in another window for verification, printing or sending by e-mail. When he opens the second window, the form's content is send automatically to the clipboard so it could be pasted in another...
2
2305
by: Wayne Wengert | last post by:
I am trying to copy the text from a textbox to the clipboard. I saw some code posted earlier for Pasting from the clipboard so I modified it for copy but it is not working (see code below). When I click on the btnCopyToClipboard I can see some processing going on but the text from the textbox is not being put on the clipboard? Thoughts or suggestions? Wayne
4
9194
by: Wayne Wengert | last post by:
I have an aspx page on which I am trying to copy the contents of a textbox to the client clipboard when the users clicks a button. The button code is as follows: ===================================== Private Sub btnCopyToClipboard_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCopyToClipboard.Click Clipboard.SetDataObject(txtHidden.Text) End Sub
3
3723
by: SAL | last post by:
I have the following VB.net Class/Function that I call from an ASP.net page: Public Class MyTestClass Public Function embedHyperlink(ByVal fileID As Integer, ByVal fileName As String) As String 'Create a New Instance of the HyperLink Control Dim createHyperLink As New System.Web.UI.WebControls.HyperLink 'Create an Instance of the ClipBoard Object
0
1412
by: Curious | last post by:
I'm working on fixing the command of "Copy to Clipboard" from a data grid. The current implementation has two problems: 1) There are two extra columns copied to clipboard that are invisible in the grid. I'll need to remove these two columns from clipboard. 2) The headings are not being copied to clipboard.
3
7305
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, i'm using the following in my console app: My.Computer.Clipboard.SetText(sb.ToString()) i'm getting inconsistent results with the copy. sometimes it works and most of the time i get the following error below. i just keep executing until it works. i'm getting the following error:
1
2135
by: defiler007 | last post by:
Hello! I want to monitor all windows copy to clipboard evets and add the objects that are copied to the clipboard to a list in my application.. how can I do that?
0
9669
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10427
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10155
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5431
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4110
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3718
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.