Insert Subpage With Selected Text As Title

Inserts a new page at the bottom of the section and makes it a subpage and makes the selected text the title. It also creates a link back to the original page.

Download

Author(s) : Onetastic ★, kewlgeek
Category : Pages
Last Updated : June 20, 2016
Requirements : OneNote 2010 or above
Changelog :

June 20, 2016 (246664) - Onetastic ★
Re-written with the new Macro Language to take advantage of cleaner syntax and performance improvements

These versions are no longer supported:

July 26, 2014 - Onetastic ★
Added link back to original page.

March 28, 2014 - kewlgeek
Initial version

Comments

Name
Comment
Omer Atay - 2016-10-30
Dan: You have missing quotes around "Page", "Paragraph", "Outline". For Instance:
InsertObject($Section, Page) should be InsertObject($Section, "Page")
Dan - 2016-10-30
Hi Omer,
unfortunately the code keeps giving me an error, unexpected parenthesis ) bracket
And I can't edit any further in the macro editor
<?xml version="1.0" encoding="utf-16"?>
<Macro name="Insert Subpages From Bold Paragraphs" category="Test Macro" description="" publishDate="00-00-00T00:00:00.000Z" version="13">
  <Expression>$copy = false</Expression>
<ForEach var="Paragraph">
    <Array>QueryObjects("Paragraph", GetCurrentPage())</Array>
    <If>
      <Condition>$Paragraph.bold</Condition>
      <Expression>$Page = InsertObject($Section, Page)</Expression>
      <Expression>QueryObjects(Paragraph, $Page)[0] = $Paragraph.text</Expression>
      <Expression>$copy = true</Expression>
      <Expression>$outline = InsertObject($Page, Outline)</Expression>
    </If>
    <Else>
      <If>
        <Condition>$copy</Condition>
        <Expression>InsertObject($outline, Paragraph).text = $Paragraph.text</Expression>
      </If>
    </Else>
  </ForEach>
</Macro>


please do advise thank you
Omer Atay - 2016-10-29
Dan: Quotes aren't expected. You should remove them.