Sample - Custom Sort Notebooks

Description : Sort notebooks by after the first 6 characters of name


Author(s) : Onetastic
Category : Samples
Last Updated : October 01, 2016
Requirements : OneNote 2010 or above
Screenshot :

Sample - Custom Sort Notebooks

No screenshot available for this macro.
Changelog :

October 01, 2016 (D9E3DB) - Onetastic
Initial Version


Omer Atay - 2016-10-02
You can specify the sortKey to be an empty string for the one you want at the top. You can check if the 6th character is a dash (-) or not if that satisfies the situation you describe. Something like:
If (String_Substring($notebook.nickname, 5, 1) == "-")
      $sortKey = ""
      $sortKey = String_Substring($notebook.nickname, 6, (String_Length($notebook.nickname) - 6))
Array_PushBack($sortKeys, $sortKey)
NicoleC - 2016-10-02
Omer, this is fantastic, thank you so very much!

So now I am getting greedy, but is there also a way to find notebooks that do not start with a number and put them on top?  For instance, I have two notebooks 12345-ABC and Nicole's Notebook.  I would like Nicole's to be at the top and the numbered ones to sort alphabetically under that!

Thank you so much for this one, you have made my life so much easier!