D
Dave Mc
Hi,
I got it into my head that I'd like to try to draw some shapes on a OneNote
page through the COM API. I'm happily using the API for various things
including creating pages and adding tables (what I'm trying to say is that
I'm not a complete novice) and am now trying something more adventurous.
For the last couple of days, I've been researching how to use the simple
drawing tools, so far to no avail. I've created a demo app that creates a
new page and then adds various items to it ie a Title and an Outline with
"hello world" text. These are happily accepted when I pass the created xml
string to UpdatePageContent(). I can also successfully create a simple ink
image using 64-bit data (I borrowed an example image from another web-site).
However, when I try to use ShapeInfo / Anchorpoint constructs, I get the
0x80042001 exception.
I give below the xml string that I'm trying to import using
UpdatePageContent. The ShapeInfo and AnchorPoint constructs are obtained
from xml produced by GetPageContent() run on another page that contains a
drawn simple horizontal line. I give the xml rather than the code as I'm
working in VB and I've noticed that most of the community works in C#. I've
added CRLFs and Tabs to aid clarity (I hope), these are not present in the
string I give to UpdatePageContent().
<?xml version="1.0" ?>
<oneage
xmlnsne="http://schemas.microsoft.com/office/onenote/2007/onenote"
ID="{2FF73249-7BD9-45BF-8829-3E3C0C29D903}{1}{B0}" name="Output Drawing"
dateTime="2009-08-17T15:15:20.000Z"
lastModifiedTime="2009-08-17T15:15:20.000Z">
<oneageSettings RTL="false" color="automatic">
<oneageSize>
<one:Automatic />
</oneageSize>
<one:RuleLines visible="false" />
</oneageSettings>
<one:Title style="font-family:Calibri;font-size:17.0pt" lang="en-US">
<one:OE author="Dave" lastModifiedBy="Dave"
creationTime="2009-08-17T15:15:20.000Z"
lastModifiedTime="2009-08-17T15:15:20.000Z"
objectID="{9D218139-156B-46E5-9BC0-7DAB13D93F30}{15}{B0}" alignment="left">
<one:T>
<![CDATA[ Output Drawing ]]>
</one:T>
</one:OE>
</one:Title>
<one:Outline>
<oneosition x="36" y="100" z="0" />
<one:Size width="600" height="154" />
<one:OEChildren>
<one:OE>
<one:T>
<![CDATA[ hello world ]]>
</one:T>
</one:OE>
</one:OEChildren>
</one:Outline>
<one:InkDrawing isUnclassified="true" inkOriginX="0" inkOriginY="0">
<oneosition x="54.0" y="266.3999938964844" />
<one:ShapeInfo isLine="true">
<one:AnchorPoint x="54.0" y="266.3999938964844" />
<one:AnchorPoint x="466.5000305175781" y="268.5" />
</one:ShapeInfo>
</one:InkDrawing>
</oneage>
I'm doing something wrong that I can't fathom or have missed the
documentation that said that it's not possible. Can anyone give me a clue as
to where I'm going wrong, please?
TIA. Dave
I got it into my head that I'd like to try to draw some shapes on a OneNote
page through the COM API. I'm happily using the API for various things
including creating pages and adding tables (what I'm trying to say is that
I'm not a complete novice) and am now trying something more adventurous.
For the last couple of days, I've been researching how to use the simple
drawing tools, so far to no avail. I've created a demo app that creates a
new page and then adds various items to it ie a Title and an Outline with
"hello world" text. These are happily accepted when I pass the created xml
string to UpdatePageContent(). I can also successfully create a simple ink
image using 64-bit data (I borrowed an example image from another web-site).
However, when I try to use ShapeInfo / Anchorpoint constructs, I get the
0x80042001 exception.
I give below the xml string that I'm trying to import using
UpdatePageContent. The ShapeInfo and AnchorPoint constructs are obtained
from xml produced by GetPageContent() run on another page that contains a
drawn simple horizontal line. I give the xml rather than the code as I'm
working in VB and I've noticed that most of the community works in C#. I've
added CRLFs and Tabs to aid clarity (I hope), these are not present in the
string I give to UpdatePageContent().
<?xml version="1.0" ?>
<oneage
xmlnsne="http://schemas.microsoft.com/office/onenote/2007/onenote"
ID="{2FF73249-7BD9-45BF-8829-3E3C0C29D903}{1}{B0}" name="Output Drawing"
dateTime="2009-08-17T15:15:20.000Z"
lastModifiedTime="2009-08-17T15:15:20.000Z">
<oneageSettings RTL="false" color="automatic">
<oneageSize>
<one:Automatic />
</oneageSize>
<one:RuleLines visible="false" />
</oneageSettings>
<one:Title style="font-family:Calibri;font-size:17.0pt" lang="en-US">
<one:OE author="Dave" lastModifiedBy="Dave"
creationTime="2009-08-17T15:15:20.000Z"
lastModifiedTime="2009-08-17T15:15:20.000Z"
objectID="{9D218139-156B-46E5-9BC0-7DAB13D93F30}{15}{B0}" alignment="left">
<one:T>
<![CDATA[ Output Drawing ]]>
</one:T>
</one:OE>
</one:Title>
<one:Outline>
<oneosition x="36" y="100" z="0" />
<one:Size width="600" height="154" />
<one:OEChildren>
<one:OE>
<one:T>
<![CDATA[ hello world ]]>
</one:T>
</one:OE>
</one:OEChildren>
</one:Outline>
<one:InkDrawing isUnclassified="true" inkOriginX="0" inkOriginY="0">
<oneosition x="54.0" y="266.3999938964844" />
<one:ShapeInfo isLine="true">
<one:AnchorPoint x="54.0" y="266.3999938964844" />
<one:AnchorPoint x="466.5000305175781" y="268.5" />
</one:ShapeInfo>
</one:InkDrawing>
</oneage>
I'm doing something wrong that I can't fathom or have missed the
documentation that said that it's not possible. Can anyone give me a clue as
to where I'm going wrong, please?
TIA. Dave