Developer: Persisting a 'handle' to a page externally

J

John McDonald

Hi,

I'm working on an add-in to an external program that will write information
to a page in OneNote when that information changes in the external app. I
need to be able to always write the updated information to the same page in
the same section/notebook. Is there a way I can externally maintain a
handle/pointer/ID to a specific page in OneNote? I thought about saving the
object ID of the page (which I assume is the same as the PageID in the
various 'Page methods), but in the 'What's New for Developers in OneNote
2007' guide, it states that the object ID can change every time OneNote is
started.

The only way I can see to do this is to maintain a list of the object titles
of the full hierarchy (notebook/section group/section/page) and traverse it
down to the page I need, but this raises the problem of the user changing the
title of any of the objects in the hierarchy (e.g. renaming the section that
contains my page).

Is there any way for me to consistently get access to a specific page in
OneNote from an external application across multiple instances of OneNote?

Thanx.

John
 
I

Ilya Koulchin

John said:
Is there any way for me to consistently get access to a specific page in
OneNote from an external application across multiple instances of OneNote?

Try using the metadata properties (look at the one:Meta tag). Metadata
applied to the page will be visible from GetHierarchy calls, and will be
the same across all instances of OneNote. Although if the user makes
multiple copies of the section, that could lead to several pages being
tagged with the same metadata.

Ilya
 
J

John McDonald

Excellent! Thank you very much. Is there any way to use the metadata to
retrieve the object directly, or will I have to read through each page to
locate the one I want? I have read through the development info available
online, but it's not clear.

Thanx again.

john
 

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