I have a small program that is listening to clipboard(hook) for images. If there is an image stored or copied through ctrl+c and the like, my program will paste the image automatically to an open word doc.
Code:
if (Clipboard.ContainsImage())
{
IDataObject obj = Clipboard.GetDataObject();
if (obj.GetDataPresent(DataFormats.Bitmap))
{
Microsoft.Office.Interop.Word.Range range = thefile.Bookmarks.get_Item(@"\endofdoc").Range;
range.Paste();
newdoc.Selection.EndKey(WdUnits.wdStory);
}
}
I just don't under stand why there are text from a certain application being copied to doc where in fact I'm only looking for bitmap data formats (based on my code). Is there a way to check if the data being copied is really an image or a text? I have no problem doing printscreen but every time I'll copy a text from a certain application (which I believe after doing ctrl+c is now stored in clipboard), the text is being considered an image?