Append Date to Title (dd.mm.yy)
Description | : | Modifies the page title to append the date in DD.MM.YY format |
Download |
---|---|---|---|
Author(s) | : | jkhanhl | |
Category | : | Title | |
Last Updated | : | June 05, 2017 | |
Requirements | : | OneNote 2010 or above | |
Screenshot | : | ||
![]() Append Date to Title (dd.mm.yy) No screenshot available for this macro. |
|||
Changelog | : | June 05, 2017 (3CEC7E) - jkhanhl |
I apologize. I'm actually a newbie when it comes to coding. However, in some cases I'm able to pick up how things work by looking at code. Can you assist me with what you're describing? Here is the XML that I have so far:
<Macro name="Append Date to Title (dd.mm.yy)" category="Title" description="Modifies the page title to append the date in DD.MM.YY format" version="18">
<Expression>$Page = GetCurrentPage()</Expression>
<Expression>$Date = QueryObjects("Page", $Page)[0].dateTime</Expression>
<Expression>$Title = QueryObjects("Paragraph", $Page)[0].text</Expression>
<Expression>$ShortYear = DateTime_Year($Date)</Expression>
<Expression>$ShortYear = ($ShortYear -= 2000)</Expression>
<Expression>QueryObjects("Paragraph", $Page)[0].text = ((((($ShortYear & ".") & (DateTime_Month($Date) & ".")) & DateTime_Day($Date)) & " - ") & $Title)</Expression>
</Macro>
I would like to take it a step further and be able to apply this to all pages in the currently selected section with one click instead of having manually select and apply to each page. Any help?