OneNote 2016 Command-Line Open To a Page

10,242

As of now, this post is 6 months old, so we may need you to update us with your status and current version number.

First off, I notice you're running a 32-bit edition on 64-bit Windows. This will be different than my setup; I'm running 64-bit on 64-bit.

My version is part of the Office 365 ProPlus package, but the OneNote 2016 version should be the same as all other packages (e.g. Office 365 Home, Office 365 Personal, OneNote Free, etc.). My current version number is 16.0.7830.1013 as of 2017-03-28.

I use a OneNote plug-in called Onetastic; one of its features can generate links/favorites to pages/section of my choice. I configured it pin items to folder of my choice.

So evaluating the links generated in the shortcuts in Pin destination, I have: onenote:https://d.docs.live.net/pathWithNumbersAndLetters/MyOneDriveFolderWithAllMyNotebooks/MyNoteBookName/SectionName.one#_removedA_&section-id={_removedB_}&page-id={_removedB_}&end

I was able to reproduce this in a command prompt with with the following syntax:

"C:\Program Files\Microsoft Office\Root\Office16\ONENOTE.EXE" /hyperlink "https://d.docs.live.net/pathWithNumbersAndLetters/MyOneDriveFolderWithAllMyNotebooks/MyNoteBookName/SectionName.one#_removedA_&section-id={_removedB_}&page-id={_removedB_}&end"

Of course, I think our goal here should be to reproduce this without a 3rd-party Tool. So I right-clicked on a Section Tab, and did Copy as Link, when pasting into a text editor, it revealed that it actually contained two links, separated by a newline.

The first link is in the https://onedrive.live.com/edit.aspx format like you show, but the second link is in the onenote:https://d.docs.live.net/pathWithNumbersAndLetters format Note, the pathWithNumbersAndLetters in the second link matches the cid= in the first link style

I think you may have, rightfully so, been been missing the second URL. When pasting this multi-line text into a single-line text box, you've only been seeing the first line of text and never knowing there was more data after it that was discarded.

When creating a shortcut in Windows Explorer, editing an existing shortcut file, or just testing in the Run Dialog, pasting the text from either Copy Link to Section or Copy Link to Page will only give you the first link, never the second link.

The first link is HTTPS:, so the registered protocol handler, your default browser, will open the link for you. However, if you were to grab and use the second link starting with onenote:, OneNote 2016 will open the shortcut for you!

  1. Copy link to section or page
  2. Paste into a text editor like Notepad or Notepad++
  3. Copy the URL on the second line starting with onenote:
  4. Create a shortcut in Windows Explorer, or run in command prompt with the following path: "C:\Program Files\Microsoft Office\Root\Office16\ONENOTE.EXE" /hyperlink "onenote:pathpathpath"
    • Note, change the path from \Program Files\ to \Program Files (x86)\ if you're still using the 32-bit edition on 64-bit windows.

Can you try and reproduce this with your setup and let me know if it works for you?

Share:
10,242

Related videos on Youtube

Ahmed
Author by

Ahmed

Updated on September 18, 2022

Comments

  • Ahmed
    Ahmed almost 2 years
    "C:\Program Files (x86)\Microsoft Office\root\Office16\ONENOTE.EXE" /hyperlink "https://onedrive.live.com/edit.aspx/Documents/Projects?cid=......"
    

    Running the above shortcut should open the page specified in the link. Instead it just gives me an error saying it cannot open files from other programs.

    This older manual (I could not find one specifically for 2016) instructs to use the /hyperlink switch.

    Any ideas?

    P.S.: The hyperlink that I used works in browser and I retrieved it by right clicking the page and clicking "Copy Link to Page"

    • J King
      J King over 7 years
      looks like these commands have been removed from 2016 - I found a few posts on MS forums where the moderator suggested adding this feature to the user voice for one note. I wish they existed as well.
  • Community
    Community about 2 years
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
  • Anaksunaman
    Anaksunaman about 2 years
    This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question. - From Review