none
OneNote 2013 object ID persistence? RRS feed

  • Question

  • Hi,

    I've written a couple of personal use add-ins for Outlook and other Office products that I use to interact with OneNote. One problem I've had to overcome is that the object IDs for OneNote 2010 objects are not persistence across instances of OneNote, so I've had to maintain an external database of the objects I'm trying to interact with and search for them each time. Has this behavior changed in OneNote 2013?

    Example: I have a table on a OneNote page that I programmatically add items to each time a certain email arrives in Outlook. I extract the data from the email and then have to search through the OneNote page content to find the table, then add it in. If there was a persistent ID for the table the job would be a lot easier.

    Thanks.

    John


    John McDonald

    Tuesday, May 21, 2013 8:23 PM

All replies

  • Hi John,

    Thank you for posting in the MSDN Forum.

    I'm trying to involve some senior engineers into this issue and it will take some time. Your patience will be greatly appreciated.

    Sorry for any inconvenience and have a nice day!

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, May 23, 2013 9:31 AM
    Moderator
  • Hi John

    I want to clarify a couple of items to make sure I understand your environment.

    • What is your add-in written in?
    • What method(s) are you using to get the object IDs in OneNote
    • You mention that "the object IDs for OneNote 2010 objects are not persistence across instances of OneNote". Do the IDs change only when moving from machine to machine, when closing and opening the notebook on the same machine, while the notebook is open, etc.?

    For example.

    • Assume you have one notebook with one section that it stored locally on the machine.
    • Within this section you have one table with address and one table with birthdates.
    • To make this easy, when you search through the page and find they tables lets say the address table returns an ID of "A" and the birthday table returns an ID of "B".
    1. If you close OneNote then reopen it on the same machine without making any changes does the address table still return an ID of "A"?
    2. If you add a third table to the section for phone numbers and then does the address table return an ID of "A"?
    3. If you close OneNote, copy the notebook to a second machine and open the copy does the address table return an ID of "A"?

    Best Regards,

    Donald M.
    Microsoft Online Community Support
    --------------------------------------------------------------------------------
    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Wednesday, July 10, 2013 8:42 PM
  • Hi The ObjectIDs are not persistent either in OneNote 2013. I recognized it, when specific file was opened on a different machine. It's better to use meta data collection of OEs and use FindMeta API (see http://answers.microsoft.com/en-us/office/forum/office_2010-onenote/obtain-a-reference-to-a-page-element-that-was/fed57abd-92d9-4bb1-a4aa-bfbccb1eb166?page=1). Regards, Roger
    Saturday, August 17, 2013 8:50 AM
  • Hi,

    I am also having issues with changing behaviour of this object-id.

    For ex:

    I have couple of pages in onenote 2013 containing hyper-links which are pointing to different parts of the same page. I have recently renamed a page and noticed that the links are not working any more. Also i moved this notebook to different location and now none of the links are working.

    My findings:

    I have picked the current location of one of the link which it should be pointing to and then compared it to the old link and notice that the object-ids (highlighted below) are different:

    Original:
    onenote:#Application%20Context%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Fine-Graned%20Access%20Control(FGAC\RLS\VPD&section-id={98FA3454-A669-40FA-9C0B-CEFF4B7A3A43}&page-id={30E69F91-D27B-4EC4-B237-D532990770C1}&object-id={E6F9900A-4DB5-0071-3DFE-21D8DC958DE9}&48&base-path=G:\Backup\OneNote%20Notebooks\sep_notes.one

     

    Current:
    onenote:#Application%20Context%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Fine-Graned%20Access%20Control(FGAC\RLS\VPD&section-id={98FA3454-A669-40FA-9C0B-CEFF4B7A3A43}&page-id={30E69F91-D27B-4EC4-B237-D532990770C1}&object-id={0DF187BF-5737-01BC-2663-608C797FCF3B}&D5&base-path=G:\Backup\OneNote%20Notebooks\sep_notes.one

    Is there a way to restore the links back to original state?

    Thanks,
    Vik


    • Edited by VikasRP Friday, October 4, 2013 8:08 PM
    Friday, October 4, 2013 8:06 PM
  •  Hi Microsoft people, is there any workaround to this issues whose came because of the same problem?

     I'm trying to replace text in some *.one files. I know how to do that, the problem is that IDs of the objects in the file changes for many reassons. I don't need to replace the text instantly, instead I need to substract *.xml's representing each page, and then make a process of replacement of all the text, which can take some time, a week meaby. Whenever I try to make the replacements back I get an error...IDs has changed. How do we resolve this?

     Thanks for your time.


    Tuesday, June 2, 2015 6:04 PM