How to insert Image to OneNote page

Add-in Express™ Support Service
That's what is more important than anything else

How to insert Image to OneNote page
 
MitchT86


Guest


Hello,

When I insert an image using the menu command, the xml looks like this.

<one:Image format="jpg" lastModifiedTime="2020-06-05T09:02:02.000Z" objectID="{1B29C2DC-9E9E-48C1-99F9-9D8E5B4206E5}{25}{B0}">
    <one:Position x="72.0" y="86.4000015258789" z="0" />
    <one:Size width="168.75" height="168.75" />
    <one:CallbackID callbackID="{1B29C2DC-9E9E-48C1-99F9-9D8E5B4206E5}{25}{B0}" />
  </one:Image>


It represents this image.
User added an image

How can I insert the image into a oneNote page by api?


Thanks for your help in advance.

Mitch
Posted 05 Jun, 2020 04:17:07 Top
Andrei Smolin


Add-in Express team


Posts: 18793
Joined: 2006-05-11
Hello Mitch,

The only method available is UpdatePageContent. I requires that you provide an XML describing the modified page.


Andrei Smolin
Add-in Express Team Leader
Posted 05 Jun, 2020 07:12:16 Top
MitchT86


Guest


Thanks for your reply.

It's possible to execute the function "Insert Printout" by api? Or it's really necessary that I add all xmlelement by hand into the xml?

regards,
Mitch
Posted 08 Jun, 2020 13:14:16 Top
Andrei Smolin


Add-in Express team


Posts: 18793
Joined: 2006-05-11
Hello Mitch,

MitchT86 writes:
It's possible to execute the function "Insert Printout" by api?


There's no such function in the OneNote Object Model.

In addition, you can't deal with built-in Ribbon control using Commandbars.GetEnabledMso(), GetImageMso, GetLabelMso, GetPressedMso, GetScreentipMso, GetSupertipMso, and GetVisibleMso() because the object model provides no way to create a CommandBars object. All other Office applications provide such a way.


Andrei Smolin
Add-in Express Team Leader
Posted 09 Jun, 2020 02:18:50 Top