Sort Selected Paragraphs

Description : Sorts selected paragraphs or list items


Sort Selected Paragraphs

You need Onetastic Add-in
for OneNote to run this macro.
Download Onetastic
Author(s) : Omer Atay
Category : Sort
Last Updated : June 20, 2016
Requirements : OneNote 2010 or above
Screenshot :

Sort Selected Paragraphs

No screenshot available for this macro.
Changelog :

June 20, 2016 (AC98C6) - Omer Atay
Re-written with the new Macro Language to take advantage of cleaner syntax and performance improvements

These versions are no longer supported:

February 07, 2015 - Omer Atay
Updated name

May 24, 2014 - Omer Atay
Initial version


Omer Atay - 2017-02-17
Dan: Macros can currently only insert things and they can't delete things like paragraphs.
Dan - 2017-02-17
Hello Omer,

I am still trying to learn how to delete paragraphs - large blocks of text
Any text or paragraphs between   #100 and #200

  <Expression>$text = ""</Expression>
  <Expression>$FirstParagraph = ""</Expression>
  <ForEach var="Paragraph">
    <Array>QueryObjects("Paragraph", GetCurrentPage())</Array>
      <Condition>!$Paragraph.selection == "none"</Condition>
      <Condition>String_StartsWith($text, "#100 ", true) &amp;&amp; String_EndsWith($text, "#200 ", true)</Condition>
      <Expression>$text += " "</Expression>
    <Expression>$text += $Paragraph.text</Expression>
    <Expression>$Paragraph.text = ""</Expression>
      <Condition>$FirstParagraph == ""</Condition>
      <Expression>$FirstParagraph = $Paragraph</Expression>

How can I delete any thing between these 2 points - I have tried a lot of things and cant make it work :(
Syed Ahsan Ali - 2016-04-16
Can spaces be added while reaarranging paragraphs