A single process or method to determine section/page/object ID numbers for all pages in MS OneNote


Is there a way — in a single step or process — to determine section/page/object id numbers for all pages in MS OneNote?

In MS OneNote, hyperlinks can be created to specific objects on specific pages by following these steps:
  1)  Select the hyperlink destination
  2)  Right-click
  3)  Select “Copy Link to Paragraph”
  4)  Select hyperlink origin (ie where the hyperlink is to be created)
  5)  Press Ctrl+k to open the "Insert Hyperlink" box
  6)  Paste
  7)  Click OK (or press Enter)

When this process is followed, the content placed on the clipboard in step #3 above has a structure (?syntax) which I have broken down into several rows and color-coded components as follows:
2015-08-14a-EE.PNGIn this screenshot,
• the items in blue are specific to the user’s computer and the organization of their OneNote content,
• the curly-bracketed items in red are hyphen-connected blocks of alphanumeric characters (with the number of characters in each block as shown) which seem to be randomly generated, and
• two final characters as shown in green which appear to reference a particular row in the selected destination.

For example, following is the hyperlink destination from one particular location in my own OneNote contents (in which I have changed only the user-specific information):


…and which, broken down, appears thus:


Using Windows Explorer, I can easily navigate to the OneNote folder indicated above but the .one files display only the SectionName.  However, the only way I can currently obtain full destination addresses is to go through all the steps listed above one page at a time.

I am looking for a single process to obtain a list of all available names in the form shown above — at least to the specificity of "page-id" —  if that is possible.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You don't say what you need the content for or in what format it needs to be returned or how regularly you need it refreshed.

I don't know of any way of doing this directly in onenote - but I'm not a regular user.

For a one off listing you could use a command prompt and 'DIR' to generate a list of files/folders under the one note folder then load that into word or excel to add any additional texts.

For a more general, programmatic approach:
Use VBA or other scripting language to do the equivalent of the DIR approach and process the output file
Onenote itself does not have a macro language but it does have an API that can be manipulated from VBA (apparently, the example I have works with 2010 and I've not got it working with 2013... yet)

If I'm up the wrong tree let me know
WeThotUWasAToadAuthor Commented:
Thanks for the comment regmigrant — and thanks especially for commenting (ie taking a crack at it) even though you are not a OneNote user. (And by the way, you are not at all "up the wrong tree".)

I am familiar (thanks to another expert in a past thread) with how to use the Command Prompt box to obtain a list of the filenames in a given folder or group of folders. And you are correct, that is a good way to obtain the "left side", so to speak, of what I am after.

However, determining how to obtain the corresponding "right side" (ie the long link-destination "addresses") is the solution I'm seeking. I did see some webpages re the OneNote API you mentioned but unfortunately, I do not know VBA so I am hoping someone can help me with.

After struggling with the attached for a while I realised its not working because I'm on a client site with mismatched versions of Office apps. I'll look at it in more details when I get to a properly configured machine but, in principle, it shows how to navigate the onenote hierarchy in vba

If you would follow the instructions and tell me if it works for you that would help

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.