473,835 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

multiple formats on the clipboard

I am trying to put a FileDrop format and a Text format dataobject onto the
clipboard so that they are both available.
I seem to be able to do one or the other but when I try to put both on only
the last entry is available on the clipboard.

Dim FileDataObject As New DataObject
Dim TextDataObject As New DataObject
Dim FileNames() As String = {myFileName}
FileDataObject. SetData(DataFor mats.FileDrop, FileNames)
Clipboard.SetDa taObject(FileDa taObject, True)
TextDataObject. SetData(DataFor mats.Text, myFileName)
Clipboard.SetDa taObject(TextDa taObject, True)

If I run the above statements only the Text format data is available on the
clipboard. If I comment out the last line then the File Format data is
available.
Since they are different formats shouldn't they both be available at the
same time.
What am I doing wrong. How do I get both formats onto the clipboard.

Thanks,
Fred
Nov 20 '05 #1
3 2309
"fred" <So***@NoSpam.c om> schrieb
I am trying to put a FileDrop format and a Text format dataobject
onto the clipboard so that they are both available.
I seem to be able to do one or the other but when I try to put both
on only the last entry is available on the clipboard.

Dim FileDataObject As New DataObject
Dim TextDataObject As New DataObject
Dim FileNames() As String = {myFileName}
FileDataObject. SetData(DataFor mats.FileDrop, FileNames)
Clipboard.SetDa taObject(FileDa taObject, True)
TextDataObject. SetData(DataFor mats.Text, myFileName)
Clipboard.SetDa taObject(TextDa taObject, True)

If I run the above statements only the Text format data is available
on the clipboard. If I comment out the last line then the File Format
data is available.
Since they are different formats shouldn't they both be available at
the same time.
What am I doing wrong. How do I get both formats onto the
clipboard.


You can only put /one/ object in the clipboard. The object might be returned
in different /formats/:

Const myFileName As String = "filename"

Dim FileDataObject As New DataObject
Dim FileNames() As String = {myFileName}

FileDataObject. SetData(DataFor mats.FileDrop, FileNames)
FileDataObject. SetData(DataFor mats.Text, myFileName)
Clipboard.SetDa taObject(FileDa taObject, True)
MsgBox(String.J oin(vbCrLf, Clipboard.GetDa taObject.GetFor mats))

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
Thanks Armin.
I'd been mucking around with this for hours.
"Armin Zingler" <az*******@free net.de> wrote in message
news:40******** *************** @news.freenet.d e...
"fred" <So***@NoSpam.c om> schrieb
I am trying to put a FileDrop format and a Text format dataobject
onto the clipboard so that they are both available.
I seem to be able to do one or the other but when I try to put both
on only the last entry is available on the clipboard.

Dim FileDataObject As New DataObject
Dim TextDataObject As New DataObject
Dim FileNames() As String = {myFileName}
FileDataObject. SetData(DataFor mats.FileDrop, FileNames)
Clipboard.SetDa taObject(FileDa taObject, True)
TextDataObject. SetData(DataFor mats.Text, myFileName)
Clipboard.SetDa taObject(TextDa taObject, True)

If I run the above statements only the Text format data is available
on the clipboard. If I comment out the last line then the File Format
data is available.
Since they are different formats shouldn't they both be available at
the same time.
What am I doing wrong. How do I get both formats onto the
clipboard.
You can only put /one/ object in the clipboard. The object might be

returned in different /formats/:

Const myFileName As String = "filename"

Dim FileDataObject As New DataObject
Dim FileNames() As String = {myFileName}

FileDataObject. SetData(DataFor mats.FileDrop, FileNames)
FileDataObject. SetData(DataFor mats.Text, myFileName)
Clipboard.SetDa taObject(FileDa taObject, True)
MsgBox(String.J oin(vbCrLf, Clipboard.GetDa taObject.GetFor mats))

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
Thanks Armin.
I'd been mucking around with this for hours.
"Armin Zingler" <az*******@free net.de> wrote in message
news:40******** *************** @news.freenet.d e...
"fred" <So***@NoSpam.c om> schrieb
I am trying to put a FileDrop format and a Text format dataobject
onto the clipboard so that they are both available.
I seem to be able to do one or the other but when I try to put both
on only the last entry is available on the clipboard.

Dim FileDataObject As New DataObject
Dim TextDataObject As New DataObject
Dim FileNames() As String = {myFileName}
FileDataObject. SetData(DataFor mats.FileDrop, FileNames)
Clipboard.SetDa taObject(FileDa taObject, True)
TextDataObject. SetData(DataFor mats.Text, myFileName)
Clipboard.SetDa taObject(TextDa taObject, True)

If I run the above statements only the Text format data is available
on the clipboard. If I comment out the last line then the File Format
data is available.
Since they are different formats shouldn't they both be available at
the same time.
What am I doing wrong. How do I get both formats onto the
clipboard.
You can only put /one/ object in the clipboard. The object might be

returned in different /formats/:

Const myFileName As String = "filename"

Dim FileDataObject As New DataObject
Dim FileNames() As String = {myFileName}

FileDataObject. SetData(DataFor mats.FileDrop, FileNames)
FileDataObject. SetData(DataFor mats.Text, myFileName)
Clipboard.SetDa taObject(FileDa taObject, True)
MsgBox(String.J oin(vbCrLf, Clipboard.GetDa taObject.GetFor mats))

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #4

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

Similar topics

2
3761
by: Trader | last post by:
Hi, I'm trying to use Mark Hammond's win32clipboard module to extract more complex data than just plain ASCII text from the Windows clipboard. For instance, when you select all the content on web page, you can paste it into an app like Frontpage, or something Rich Text-aware, and it will preserve all the formatting, HTML, etc. I'd like to include that behavior in the application I'm writing. In the interactive session below, before I...
4
5396
by: Richard Hollenbeck | last post by:
I'm trying to write some code that will convert any of the most popular standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan 1908) and compare the first with the second and calculate days, months, and years. This is not for a college course. It's for my own personal genealogy website. I'm stumped about the code. I'm working on it but not making much progress. Is there any free code available anywhere? I know it...
2
1803
by: Subodh | last post by:
Hi, Currently we get data from more then 200 different sources and all of our vendors provide data in different file formats. The problem is we have more then 100 DTS packages now and the maintainance is very diffucult. Every time our vendor changes the format we have to change in multiple DTS packages. Is anybody know what would be the right way of reducing the no. of DTS packages.
0
1222
by: Hai NIng | last post by:
Does any one know how to implement a multiple-storage clipboard, sort of like the clipboard in office where it can hold multiple number of text/image/custom data, etc.? Thanks. - Harry
2
2017
by: **Developer** | last post by:
If I select files in Windows Explorer and click Copy I find the following formats on the clipboard. I know what FileDrop contains. How can I find out what the others are used for? FileDrop FileName FileNameW Shell IDList Array Preferred DropEffect
4
395
by: fred | last post by:
I am trying to put a FileDrop format and a Text format dataobject onto the clipboard so that they are both available. I seem to be able to do one or the other but when I try to put both on only the last entry is available on the clipboard. Dim FileDataObject As New DataObject Dim TextDataObject As New DataObject Dim FileNames() As String = {myFileName} FileDataObject.SetData(DataFormats.FileDrop, FileNames)...
1
252
by: ljlevend | last post by:
The help for the Windows.Forms.Clipboard class states, "Place data on the clipboard in multiple formats to maximize the possibility that a target application, whose format requirements you might not know, can successfully retrieve the data." So how do you do that? I want to place text and an image on the Clipboard at the same time. But, when I run the following test code only the text is on the Clipboard: Dim bmp As New...
4
1542
by: Thom Little | last post by:
I have a form with three textboxes. In an external C# 2.0 application I need to load the clipboard with three pieces of information so I can position to the first textbox in the forma and select paste to paste into all three at the same time. something like ... one\ttwo\tthree or one\ntwo\nthree
1
2625
by: feltra | last post by:
Hi, The following is from my friend who has only restricted net access from his office and hence cannot post.... -------------------------------------------------------------------------------------------------- I am trying to export a GridView data to multiple file formats. The requirement is that when more than one file format is selected and the "Submit" button is clicked, the data from the grid needs to get exported to multiple...
8
8099
by: kroogar | last post by:
Hi gurus .Net 2.0 I'm on a project where I need to be able to detect if my clipboard contains BOTH images AND text (eg. when copying from a web page). For some reason Clipboard.ContainsImage() only returns true if the clipboard contains one and only one image. I use Clipboard.GetDataObject().GetDataPresent(DataFormats.Text) to detect the presence of text. What I need to figure out is how to detect if the clipboard contains one or...
0
9808
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
9652
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10812
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...
0
10523
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10235
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7766
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6966
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5638
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...
1
4434
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

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.