GetData images from OneNote

G

Guest

I have done a screen clipping in oneNote and now want to save to file.

So I copy the image in oneNote, and then using c# try and getData from the
clipboard and store in an image to be able to save to file.

However unlike Word, OneNote does not paste a bitmap compatible image to the
clipboard. It does sat is supports EnhancedMetaFile, DeviceIndependentBitmap,
OneNote internal or HTML.

The first 2 return when used with getdata return null.

Is this a bug in OneNote or my VS code?

oDataObj.GetDataPresent(DataFormats.MetafilePict); returns true

oDataObj.GetData(DataFormats.MetafilePict); returns null

Same for Dib and EnhancedMetafile.

Simon
 
G

Guest

Hi Simon,

I can only recommend you to try:
oDataObj.GetFormats(true);

Read "IDataObject.GetFormats" for more info.

HTH
Marcin
 
G

Guest

I did that and it returned the 4 formats I mention.

Bizarrely it now seems to work, which is great I now have a systray icon
that on clicking will popup a save dialog, and save the clipboard image to a
file. No having to start word, etc.

Simon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top