Sort Selected Paragraphs

Sorts selected paragraphs or list items

Download

Author(s) : Onetastic ★
Category : Sort
Last Updated : February 12, 2023
Requirements : OneNote 2010 or above
Watch this short video to learn more about this macro
Screenshot :

Sort Selected Paragraphs

Sort direction
Changelog :

February 12, 2023 (EE7D53) - Onetastic ★
Added menu and dialog box with sort direction

June 20, 2016 (AC98C6) - Onetastic ★
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 - Onetastic ★
Updated name

May 24, 2014 - Onetastic ★
Initial version

Comments

Name
Comment
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>
    <If>
      <Condition>!$Paragraph.selection == "none"</Condition>
      <Continue>1</Continue>
    </If>
    <If>
      <Condition>String_StartsWith($text, "#100 ", true) &amp;&amp; String_EndsWith($text, "#200 ", true)</Condition>
      <Expression>$text += " "</Expression>
    </If>
    <Expression>$text += $Paragraph.text</Expression>
    <Expression>$Paragraph.text = ""</Expression>
    <If>
      <Condition>$FirstParagraph == ""</Condition>
      <Expression>$FirstParagraph = $Paragraph</Expression>
    </If>
  </ForEach>


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