1

I have mixed data which consists of image and text on clipboard copied from word document. Now I wanted to check if mixed data is present on clip board. how to perform this check.

ClipBoard.GetImage() which returns false if i have mixed mode of data on clipboard.

Movva
  • 140
  • 1
  • 3
  • 11

1 Answers1

1

Use Clipboard.GetDataObject() which will return an IDataObject.

Retrieve stored data from an IDataObject by calling the GetData method and specifying the data format in the format parameter. Set the autoConvert parameter to false to retrieve only data that was stored in the specified format. To convert the stored data to the specified format, set autoConvert to true, or do not use autoConvert.

To determine the formats of the data stored in an IDataObject, use the following IDataObject methods.

Call the GetFormats method to retrieve an array of all the formats in which the data is available. Set the autoConvert parameter to false to get only the formats in which the data is stored. To get all the formats in which the data is available, set autoConvert to true, or do not use this parameter. Call the GetDataPresent method to determine whether stored data is available in a certain format. If you do not want stored data to be converted to the specified format, set the autoConvert parameter to false.

Hope this helps.

Ref: IDataObject Interface

How can I get an image out of the clipboard without losing the alpha channel in .NET?

Community
  • 1
  • 1
Bala
  • 256
  • 1
  • 5
  • I have same formats when I copied Text or both Text and Image to clipboard from word document. Object Descriptor Rich Text Format HTML Format Text UnicodeText EnhancedMetafile MetaFilePict Embed Source Link Source Link Source Descriptor ObjectLink Is there anyway to determine which format has text data and which one has image data. Many of above formats return memory stream in both cases (text or Both Text and image) – Movva Feb 15 '17 at 18:30