Question about OneNote API

D

DGS

Hello,

The old 2003 api did not allow you to enter an object at the current cursor
location. Do you know if the new API for OneNote 2007 allows for this?


Thanks,
Derek
 
I

Ilya Koulchin

DGS said:
The old 2003 api did not allow you to enter an object at the current cursor
location. Do you know if the new API for OneNote 2007 allows for this?

There is no explicit "insert at cursor" command, however, you can get
the selection when exporting the page content, and then import your
changes at the selected location. You will be able to get the selection
location even if nothing is selected - in that case, you'll just see an
empty text block in the XML that is marked as selected.

Ilya
 
D

DGS

<?xml version="1.0" ?>
- <one:page
xmlns:eek:ne="http://schemas.microsoft.com/office/onenote/2007/onenote"
ID="{B0B6D4E7-DBBF-4279-A9E2-085EFC128000}{1}{B0}" name="test"
dateTime="2007-03-23T16:57:14.000Z"
lastModifiedTime="2007-03-23T19:24:35.000Z" isCurrentlyViewed="true"
selected="partial" style="font-family:Calibri;font-size:11.0pt" lang="en-US">
- <one:pageSettings RTL="false" color="automatic">
- <one:pageSize>
<one:Automatic />
</one:pageSize>
<one:RuleLines visible="false" />
</one:pageSettings>
- <one:Title style="font-family:Calibri;font-size:17.0pt" lang="en-US">
- <one:OE author="d" lastModifiedBy="d"
creationTime="2007-03-23T16:57:17.000Z"
lastModifiedTime="2007-03-23T19:24:35.000Z"
objectID="{118E03D9-24DF-45A2-B902-05F1C46F9919}{15}{B0}" alignment="left">
- <one:T>
- <![CDATA[ test
]]>
</one:T>
</one:OE>
</one:Title>
- <one:Outline selected="partial" author="d" lastModifiedBy="d"
lastModifiedTime="2007-03-23T19:24:16.000Z"
objectID="{29CC9639-B3B0-4AC9-B80C-2470B9F1F2F8}{197}{B0}">
<one:position x="72.0" y="402.9754333496094" z="4" />
<one:Size width="72.0" height="13.42773056030273" />
- <one:OEChildren selected="partial">
- <one:OE creationTime="2007-03-23T19:24:16.000Z"
lastModifiedTime="2007-03-23T19:24:16.000Z"
objectID="{29CC9639-B3B0-4AC9-B80C-2470B9F1F2F8}{198}{B0}" alignment="left"
selected="partial">
- <one:T selected="all">
- <![CDATA[
]]>
</one:T>
</one:OE>
</one:OEChildren>
</one:Outline>

</one:page>


Ok, I am able to pull the xml from the current page, and I understand that
the cursor is where selected="all" but I can not figure out the correct xml
syntax for an image.

According to MSDN, an image can either be referenced in a file or is
included inline in base64 encoded.. It does not really go into much detail
other wise.

I am thinking I would want to replace the - <one:T selected="all">
- <![CDATA[
]]>
</one:T>

with something like <one:Image path="pathToPicture"> </one:Image> but I have
not had any luck.

Thanks,
D
 
D

DGS

Figures that I would get it working just after I posted.

Heres what I went with:

<one:Image><one:File path="c:\wallpaper.png"/></one:Image>



DGS said:
<?xml version="1.0" ?>
- <one:page
xmlns:eek:ne="http://schemas.microsoft.com/office/onenote/2007/onenote"
ID="{B0B6D4E7-DBBF-4279-A9E2-085EFC128000}{1}{B0}" name="test"
dateTime="2007-03-23T16:57:14.000Z"
lastModifiedTime="2007-03-23T19:24:35.000Z" isCurrentlyViewed="true"
selected="partial" style="font-family:Calibri;font-size:11.0pt" lang="en-US">
- <one:pageSettings RTL="false" color="automatic">
- <one:pageSize>
<one:Automatic />
</one:pageSize>
<one:RuleLines visible="false" />
</one:pageSettings>
- <one:Title style="font-family:Calibri;font-size:17.0pt" lang="en-US">
- <one:OE author="d" lastModifiedBy="d"
creationTime="2007-03-23T16:57:17.000Z"
lastModifiedTime="2007-03-23T19:24:35.000Z"
objectID="{118E03D9-24DF-45A2-B902-05F1C46F9919}{15}{B0}" alignment="left">
- <one:T>
- <![CDATA[ test
]]>
</one:T>
</one:OE>
</one:Title>
- <one:Outline selected="partial" author="d" lastModifiedBy="d"
lastModifiedTime="2007-03-23T19:24:16.000Z"
objectID="{29CC9639-B3B0-4AC9-B80C-2470B9F1F2F8}{197}{B0}">
<one:position x="72.0" y="402.9754333496094" z="4" />
<one:Size width="72.0" height="13.42773056030273" />
- <one:OEChildren selected="partial">
- <one:OE creationTime="2007-03-23T19:24:16.000Z"
lastModifiedTime="2007-03-23T19:24:16.000Z"
objectID="{29CC9639-B3B0-4AC9-B80C-2470B9F1F2F8}{198}{B0}" alignment="left"
selected="partial">
- <one:T selected="all">
- <![CDATA[
]]>
</one:T>
</one:OE>
</one:OEChildren>
</one:Outline>

</one:page>


Ok, I am able to pull the xml from the current page, and I understand that
the cursor is where selected="all" but I can not figure out the correct xml
syntax for an image.

According to MSDN, an image can either be referenced in a file or is
included inline in base64 encoded.. It does not really go into much detail
other wise.

I am thinking I would want to replace the - <one:T selected="all">
- <![CDATA[
]]>
</one:T>

with something like <one:Image path="pathToPicture"> </one:Image> but I have
not had any luck.

Thanks,
D



Ilya Koulchin said:
There is no explicit "insert at cursor" command, however, you can get
the selection when exporting the page content, and then import your
changes at the selected location. You will be able to get the selection
location even if nothing is selected - in that case, you'll just see an
empty text block in the XML that is marked as selected.

Ilya
 
E

EMRhelp.org

Figures that I would get it working just after I posted.

Heres what I went with:

<one:Image><one:File path="c:\wallpaper.png"/></one:Image>



DGS said:
<?xml version="1.0" ?>
- <one:page
xmlns:eek:ne="http://schemas.microsoft.com/office/onenote/2007/onenote"
ID="{B0B6D4E7-DBBF-4279-A9E2-085EFC128000}{1}{B0}" name="test"
dateTime="2007-03-23T16:57:14.000Z"
lastModifiedTime="2007-03-23T19:24:35.000Z" isCurrentlyViewed="true"
selected="partial" style="font-family:Calibri;font-size:11.0pt" lang="en-US">
- <one:pageSettings RTL="false" color="automatic">
- <one:pageSize>
<one:Automatic />
</one:pageSize>
<one:RuleLines visible="false" />
</one:pageSettings>
- <one:Title style="font-family:Calibri;font-size:17.0pt" lang="en-US">
- <one:OE author="d" lastModifiedBy="d"
creationTime="2007-03-23T16:57:17.000Z"
lastModifiedTime="2007-03-23T19:24:35.000Z"
objectID="{118E03D9-24DF-45A2-B902-05F1C46F9919}{15}{B0}" alignment="left">
- <one:T>
- <![CDATA[ test
]]>
</one:T>
</one:OE>
</one:Title>
- <one:Outline selected="partial" author="d" lastModifiedBy="d"
lastModifiedTime="2007-03-23T19:24:16.000Z"
objectID="{29CC9639-B3B0-4AC9-B80C-2470B9F1F2F8}{197}{B0}">
<one:position x="72.0" y="402.9754333496094" z="4" />
<one:Size width="72.0" height="13.42773056030273" />
- <one:OEChildren selected="partial">
- <one:OE creationTime="2007-03-23T19:24:16.000Z"
lastModifiedTime="2007-03-23T19:24:16.000Z"
objectID="{29CC9639-B3B0-4AC9-B80C-2470B9F1F2F8}{198}{B0}" alignment="left"
selected="partial">
- <one:T selected="all">
- <![CDATA[
]]>
</one:T>
</one:OE>
</one:OEChildren>
</one:Outline>
</one:page>

Ok, I am able to pull the xml from the current page, and I understand that
the cursor is where selected="all" but I can not figure out the correct xml
syntax for an image.
According to MSDN, an image can either be referenced in a file or is
included inline in base64 encoded.. It does not really go into much detail
other wise.
I am thinking I would want to replace the - <one:T selected="all">
- <![CDATA[
]]>
</one:T>
with something like <one:Image path="pathToPicture"> </one:Image> but I have
not had any luck.

"Ilya Koulchin" wrote:

- Show quoted text -

DGS, are you developing a OneNote product ?
 
D

DGS

Yes, I am developing something that integrates with OneNote 2007.

Today, I started writing an Object Oriented Wrapper for the nasty OneNote
2007 xml API. I am not sure though how deep I will make this wrapper. So
far, it holds all the information up to the page. All the page elements have
yet to integrated into it and I am not sure if I will have time to do the
page elements.

Later,
D


EMRhelp.org said:
Figures that I would get it working just after I posted.

Heres what I went with:

<one:Image><one:File path="c:\wallpaper.png"/></one:Image>



DGS said:
<?xml version="1.0" ?>
- <one:page
xmlns:eek:ne="http://schemas.microsoft.com/office/onenote/2007/onenote"
ID="{B0B6D4E7-DBBF-4279-A9E2-085EFC128000}{1}{B0}" name="test"
dateTime="2007-03-23T16:57:14.000Z"
lastModifiedTime="2007-03-23T19:24:35.000Z" isCurrentlyViewed="true"
selected="partial" style="font-family:Calibri;font-size:11.0pt" lang="en-US">
- <one:pageSettings RTL="false" color="automatic">
- <one:pageSize>
<one:Automatic />
</one:pageSize>
<one:RuleLines visible="false" />
</one:pageSettings>
- <one:Title style="font-family:Calibri;font-size:17.0pt" lang="en-US">
- <one:OE author="d" lastModifiedBy="d"
creationTime="2007-03-23T16:57:17.000Z"
lastModifiedTime="2007-03-23T19:24:35.000Z"
objectID="{118E03D9-24DF-45A2-B902-05F1C46F9919}{15}{B0}" alignment="left">
- <one:T>
- <![CDATA[ test
]]>
</one:T>
</one:OE>
</one:Title>
- <one:Outline selected="partial" author="d" lastModifiedBy="d"
lastModifiedTime="2007-03-23T19:24:16.000Z"
objectID="{29CC9639-B3B0-4AC9-B80C-2470B9F1F2F8}{197}{B0}">
<one:position x="72.0" y="402.9754333496094" z="4" />
<one:Size width="72.0" height="13.42773056030273" />
- <one:OEChildren selected="partial">
- <one:OE creationTime="2007-03-23T19:24:16.000Z"
lastModifiedTime="2007-03-23T19:24:16.000Z"
objectID="{29CC9639-B3B0-4AC9-B80C-2470B9F1F2F8}{198}{B0}" alignment="left"
selected="partial">
- <one:T selected="all">
- <![CDATA[
]]>
</one:T>
</one:OE>
</one:OEChildren>
</one:Outline>
</one:page>

Ok, I am able to pull the xml from the current page, and I understand that
the cursor is where selected="all" but I can not figure out the correct xml
syntax for an image.
According to MSDN, an image can either be referenced in a file or is
included inline in base64 encoded.. It does not really go into much detail
other wise.
I am thinking I would want to replace the - <one:T selected="all">
- <![CDATA[
]]>
</one:T>
with something like <one:Image path="pathToPicture"> </one:Image> but I have
not had any luck.

"Ilya Koulchin" wrote:
DGS wrote:
The old 2003 api did not allow you to enter an object at the current cursor
location. Do you know if the new API for OneNote 2007 allows for this?
There is no explicit "insert at cursor" command, however, you can get
the selection when exporting the page content, and then import your
changes at the selected location. You will be able to get the selection
location even if nothing is selected - in that case, you'll just see an
empty text block in the XML that is marked as selected.
Ilya- Hide quoted text -

- Show quoted text -

DGS, are you developing a OneNote product ?
 

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