Quantcast
Channel: General Office Development forum
Viewing all articles
Browse latest Browse all 2257

How To Programatically Create Linked Notes in OneNote?

$
0
0

I'm working on an add-in for OneNote to help me automate some of my task organization. I'm copying items from one part of my notebook to another section of my notebook and it's 95% of the way there, but the one piece I can't figure out is creating LinkedNotes. I believe my schema is correct:

        <one:LinkedNote state="0">
          <one:LinkedNoteUri><![CDATA[notelink://blahblahblah]]></one:LinkedNoteUri>
          <one:LinkedNoteShortName><![CDATA[My Link!]]></one:LinkedNoteShortName>
          <one:LinkedNoteFriendlyName><![CDATA[My Link!]]></one:LinkedNoteFriendlyName>
        </one:LinkedNote>

 

I believe the problem is the actual Uri. When looking at existing linkednotes the URI looks liked this:

notelink://FBF634D2-884D-4BEA-88C1-174E5187AF0D/onenote%3ATime%26section-id%3D%7B02FE7AAF-7BC9-4F97-A7B2-B46ECEBB2BBA%7D%26page-id%3D%7B8857B2AA-4D63-4A8F-84C9-70A07D0F75EB%7D%26object-id%3D%7BDB6EF273-8B33-09B3-127A-7339FE620CE6%7D%26

Or Url decoded:

notelink://FBF634D2-884D-4BEA-88C1-174E5187AF0D/onenote:Time&section-id={02FE7AAF-7BC9-4F97-A7B2-B46ECEBB2BBA}&page-id={8857B2AA-4D63-4A8F-84C9-70A07D0F75EB}&object-id={DB6EF273-8B33-09B3-127A-7339FE620CE6}&

The problem, I believe, is the IDs I get from the hierarchy. Example:

NotebookID: {C9D7064B-3BE9-4B47-ADAE-831DAAAD4334}{1}{B0}
SectionID: {5A643683-78AF-00B9-2CF8-5870571CB377}{1}{B0}
PageID: {5A643683-78AF-00B9-2CF8-5870571CB377}{1}{E1947155439090587235891923370519797889716581}
ObjectID: {57751C52-B7D1-4812-B6E8-C601602D0BC0}{101}{B0}

When I attempt to use those in the pattern:
notelink://MyNotebookID/onenote:PageName&section-id=MySectionID&page-id=MyPageID&object-id=MyObjectID&

It fails. Does anyone know if its possible to get the guids that are used to form the linkedNotes?


Viewing all articles
Browse latest Browse all 2257

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>