macroland Macroland

Search "macro"

分别设置中英文字体
如果选中部分文本,则只对选中部分进行修改,否则对当前页面所有文本修改。 默认中文设为“宋体”,英文设为“Times New Roman”。如果需要更换其他字体,可以编辑这个 Macro,分别设置 cnFont 和 enFont 为自己想要的字体即可。 ;如果需要统一设置字体大小也可以设置变量 fontSize 的值。 关于 OneNote 设置中英文字体,如需了解更多,请移步 http://t.cn/RT8Imz9 ,欢迎一起讨论。 (PS:大家如果遇到什么问题,或有什么其他需求可以给我留言(请留下联系方式,以便通知您),或直接发邮件到 wenmin92@gmail.com,也可以添加微信 wenmin92)
Team Activity Tracker
We use OneNote as an activity tracker for my small team of IT Support techs. Each day has its own page, with a table for tracking our work. Each month is its own section, and each year is a section group. This Macro allows me to create an entire year's worth of blank pages in about 5 minutes. I know there's more that could be done to improve it, but I havent the time. Feel free to use or edit this in any way that suits you. Thanks to Omer for a fantastic product, and great support!
Set All Images in a Page as Background
This macro sets all images on the page to a background image, usefull for large printouts
Show Month
This macro will insert a month calendar for the specified month. The events are the titles of pages form one or two sections in the same notebook, based on the creation time for the page. A page whose title has a tag will show the tag instead of the time. Each calendar event links to the relevant page.
Sort Selected Todos
Sort Todo boxes by checked/unchecked. Select the paragraphs that have todo checkboxes and run this macro.
Outlook Email Date Stamp
This macro will change the creation date of each page in the current section with the time the email was sent, allowing them to be sorted by the email date. This has been made specifically for emails sent to OneNote from Outlook.
全页字体微软雅黑
Changes text font on current page to Microsoft Yahei (for Chinese typing, refers to macro'Font -> Calibri')
Fit printout images to Letter template - for entire section
If you import an 8.5x11 page from a printout (Ex. from a PDF) into OneNote, this macro will fit the image to the size of the Letter template and also set the image to background, making it ready to annonate and easily print out to paper if necessary. Note that this will only work when using the Letter template included in OneNote. This macro will apply the change across all pages in the current section, for when the imported printout's pages are spread across multiple subpages in OneNote.
Customize the Title
This macro is intended to show how to customize the title. You have to select the first paragraph in the current page and replace the text
Add link
ADD A LINK-TO-ORIGINAL-FILE THAT IS MISSING Procedure: 1-Shift + right click on the file 2-Choose Copy as Path 3-Go to OneNote, Onetastic Link > Add Link (the macro) 4-Paste it in the box with Ctrl+V
Rainbow your notebooks and sections
This macro will color all your notebooks and sections as a rainbow. Feel free to enter the macro and modify the color array (also the if statements)
Template Project Notebook
Creates sections for a new Project Notebook. It is recommended that you create an empty notebook in SharePoint and then run this macro while in that notebook.
Custom Theme
apply your theme. please edit macro.
Prio
This macro is to sort a prioritized To Do list, colors them based on priority and status. You need to select the To Do list to sort them. Indented sections are treated as one, and sorting will not harm them.
Insert YYYY-MM-DD
Insert YYYY-MM-DD. Original macro by alarsen: https://getonetastic.com/macroland&id=97AF320199992D0BAA87AD68887C8885
Toggle Complete/Strikethrough and Sort
Toggles the Todo tag Complete/Incomplete and Strikethrough of the selected paragraph. Then, sorts completed items at the bottom. This is a combonation of two existing macros.
Undo No spell check
Undoes "No spell check" macro. This allows OneNote to display spell check (red squiggles) in selected text if one has previously disabled this feature through the "No spell check" macro.
White Theme
To reset theme to defaults which is white background with black font colour, this macro is very useful if you are unable to undo changes of custom theme such as black theme, etc
Task Count + Tags
Modified version of Task Count by Dawid. This macro counts all checkboxes and adds how many are completed to the title of the page. It also counts how many exclamation, question, star, and pin tags there are. This version counts all checkbox style tags (including CheckBox priority 1 - n, meeting checkboxes, starred checkboxes etc). Furthermore, it counts all checkbox tags applied to the same paragraph rather than just 1, so if two checkbox tags are applied to the same paragraph, it will count both of them.
Make Blank Annual Journal
Select any year between 2013 and 2028 and this macro wil create a Journal for you. Each month is a section, and each month has a page per day, There is also a calendar tab that you can use the "Insert Calendar" macro to fill (I may later extend the macro to do that automatically, and also remove the New Section that is created when you open a new notebook). Future years extensions are a matter of adding a handful of new statements in the macro, but everything in OneNote may have changed by then, so I'll defer that one for now.
BP: _Create TOC
This macro creates a TOC table of the sub-pages in this section. This macro is designed that each sub-page is a separate tasks for a to-do list. The other macros in this set change tags in the titles of the sub-pages that this TOC macro interprets and puts in symbols for Complete, Delegated, In Progress, Deleted, or Time Critical
Distribute Columns
Distribute the width of the selected columns equally between them. This macros is similar to the command of the same name in Microsoft Word.
Collapse All Parents
Collapse all parent outline elements (based on the macro Collapse Parents but does it on the parents of the parents and so on)
Add @Context
In function of the Todo.txt concept, add a context to all tags that have the name "Takenlijst" in the Dutch OneNote. In English it must be "To Do" I think so you'd have to correct it in this macro. Contexts are defined in the Prompt-function so you'd have to adjust it to your likings.
Align Left
Left align all selected outlines with the first one. You may wan to to add an empty outline on Top of the page before executing the macro to set a specific position.
Add icon to all emails
This macro will change the title of each page in the current section to add an email emoji to the beginning (unless it already has one). This has been made specifically for emails sent to OneNote from Outlook. Great from seeing all emails in a section at a glance.
Clean Hyperlinks and HTML spaces
Removes all friendly hyperlinks in the current page and any "&"nbsp";" that may subsequently appear. Many thanks to omeratay for both the original hyperlink macro and the software environment in which generate macros!
全页字体微软雅黑(含表格)
Changes text font on current page to Microsoft Yahei (for Chinese typing, refers to macro'Font -> Calibri')
Fit printout images - for entire section
Fit printout images to page widht and place them in the top of the page. It will consider RTL page setting. If you import an 8.5x11 page from a printout (Ex. from a PDF) into OneNote, this macro will fit the image to the page widht and also set the image to background, making it ready to annonate and easily print out to paper if necessary. This macro will apply the change across all pages in the current section, for when the imported printout's pages are spread across multiple subpages in OneNote.
Print/SaveAs SimpleHelper - Grid 0.5" on LetterPaper
First, manually apply Letter size w/ margins T&B 0.5" and L&R 1". Then, run this macro to see the "ideal"printable-area if scale-down is not applied. See the comments in Macroland for more information.
Select all printout images beneath selected printout page.
This macro will select every picture with a subsequent printout page number so that they can be deleted, probably. Useful for inserted lecture slides that come in sets which encompass multiple lectures. I intend to make a more general version of this which selects images in a page based on y position instead of printout page number.
DivideTwoCells
Divides Two Cells in a row or a column in a Table, Select 3 Cells, the Cell to be divided first then the Divisor and a Blank Cell for the Quotient and run the Macro.
Task Count++
Modified version of Task Count by Dawid. This macro counts all checkboxes and adds how many are completed to the title of the page. This version counts all checkbox style tags (including CheckBox priority 1 - n). Furthermore, it counts all tags applied to the same paragraph rather than just 1, so if two checkbox tags are applied to the same paragraph, it will count both of them.
Matrix to Table
Convert a matrix into a table. To use this macro, you need first change your matrix into plain text by using Alt+"=".
Sample Notebook/Section/Page Picker
Sample macro showing how to allow user pick a notebook, then a section, than a page
Convert Copied Paths to File Hyperlinks Macro
Converts selected pasted "Copied Paths" into file hyperlinks. This provides similar functionality now removed from OneNote that allowed files copied from windows explorer to be pasted as hyperlinks. To use; 1-Ctrl Select multiple files within windows explorer, 2-Shift + right click one of the selected files, 3-Choose "Copy as Path" from context menu, 4-Go to OneNote and paste into a page, 5-Select all pasted paragraphs, 6-Select "Convert Copied Paths to File Hyperlinks" from Onetastic's hyperlink menu. See a demo of the macro in action at https://youtu.be/22nMT8wy8Cc. If you find this macro useful please donate to http://www.paypal.me/SimonRear to encourage the development of more useful timesavers.
HTML Space
Replace the HTML space character "&nbsp" with a space " ". Helpful following use of hyperlink removal macro.
Link to Google
Select text and hyperlink to directly google search page. A child of the macro "Text to Web Search Link". Try "Set a reminder after 5 minutes" type commands too.
Fit printout A4 to A3 page - for entire section
Fit printout A4 pages to right side of A3 landscape pages (if the page not set to landscape, it will set it) . It will consider RTL page setting. If you import an A4 pages from a printout (Ex. from a PDF) into OneNote, this macro will fit it to the page and also set the image to background, making it ready to annonate and easily print out to paper if necessary. This macro will apply the change across all pages in the current section, for when the imported printout's pages are spread across multiple subpages in OneNote.
Fit printout images to Letter template (printer-friendly) - for entire section
If you import Letter-size page from a printout (e.g. from a PDF file) into OneNote, this macro will fit the image to the size of the Letter template, but also ensure that the printing bug in OneNote doesn't make printing the page to PDF or actual paper is not a nightmare (by scaling the printout image to be slightly smaller than the page size).
Reformat Quick Paste text and URL into a hyperlink
Select pasted text and link from a web page, then run a macro - the URL will be added as a Hyperlink to the text.
Bring selected stacked image to front
Simple macro using z property - useful for stacked offset images
Add link and rename URL text to display
ADD A LINK-TO-ORIGINAL-FILE THAT IS MISSING Procedure: 1-Shift + right click on the file; 2-Choose Copy as Path; 3-Go to OneNote, Onetastic Link > Add Link (the macro); 4-Paste it in the box with Ctrl+V; 5-Type a custom document name or Paste the URL and modify it to your linking
Template Litigation Notebook
Creates sections for the LawToolBox Template Litigation Notebook. It is recommended that you create an empty notebook and then run this macro while in that notebook.
全页字体等线
Changes text font on current page to Microsoft Yahei (for Chinese typing, refers to macro'Font -> Calibri')
Set All Images in a Section as Background
This macro sets all images in the section to a background image, useful for large printouts.
Vote Count
This macro will count the todo list tag for voting purposes on a collaboration workspace such as on OneNote Classroom Creator. The result of the vote is displayed on the header. in order to use the Vote count you should create a list of voters. Giving them a to do list. Each votore check the to do list. it means voted.
BP: In Progress v2
This macro takes the selected subpage and adds an in progress tag to the title of the subpage
Date Modifier for Imported Email from Outlook
This macro is essentially a modified version of the "Outlook Email Date Stamp" by Omer Atay and JasonDaSilva. The modification is that the user prompt is in french and the macro works for e-mails in french and german. It should also work for italian but it wasn't tested. As of early 2020, imported e-mails seem to have some information in english (namely the fields such as "sent", "from", and so on) even though the system and program were installed in a different language. Therefore the macro got adapted to handle e-mails with english fields, even though it should have been in another of the available languages. Description of the original macro: "This macro will change the creation date of each page in the current section with the time the email was sent, allowing them to be sorted by the email date. This has been made specifically for emails sent to OneNote from Outlook."
tag un/completed sort,created/completed date entry
This Macro sorts the tags in Completed and uncompleted order. It also appends created date and Completed date in the end.
Sort Paragraphs by Highlight Color
Sort selected the paragraphs by the highlight color on them. You can use this after using "Extract Highlighted Text" macro to sort the extracted text by highlight color
Samy --> InsertRow
Sample macro showing how to rearrange rows in a table
Template for Quick Notes
This macro create a template on the top of the section, and provide a table that you can write your ideas by topics. The code is a sample and can be changed to fit your own style. Feel free to contact me at iamcary@126.com
BP: Completed
When on a page, this macro adds a completed tag to the title
Enumerate Hyperlinks Folder Name
Enumerates selected file hyperlinks source url folder name allowing it to be subsequently copied into windows explorer to quickly navigate to that folder. This avoids having to edit the hyperlink and remove embedded html codes. The folder name is appended as text selected, ready for you to copy. See a demo of the macro in action at https://youtu.be/Mc_WpnVOcr4. If you find this macro useful please donate to http://www.paypal.me/SimonRear to encourage the development of more useful timesavers.
Template SCorpBooks Notebook
Creates sections for the LawToolBox Template SCorpBooks Notebook. It is recommended that you create a new empty notebook and then run this macro while in that notebook.
BP: Time Critical v2
This macro changes the title of the currently selected subpage (where the cursor is) and add the Time Critical tag to the title
Sample - Move Last Row To Top
Sample macro showing how to rearrange rows in a table
BP: Completed v2
When the cursor is on a page link, this macro adds a complete tag to the page title
Page and Title modifier for imported Outlook Emails
This macro works for e-mails imported in OneNote from Outlook only. The user prompt is in french. What it does is set the OneNote page date to the one of the e-mail within it. Added to that, it also changes the title of the page by adding the date of the e-mail at the beginning of it and add a few glyphs showing that it's an e-mail, if there are any attachments and finally if the e-mail was sent or received. The macro handles dates in german, french and italian.
Add *yymmdd* as Note title prefix for all Pages in Current Section
Add *yymmdd* as Note title prefix for all Pages in Current Section. Usage: select desired Section to add *yymmdd* before running macro. If Page already starts with 20** or 18** then that note will be skipped. If Page does not have the title: the first line will become the title -> trick: don't bother naming your note. Just type the first line with your intended title. Then run this macro once after every while.
Add *yymmdd* as Note title prefix for all Pages in Current Section
Add *yymmdd* as Note title prefix for all Pages in Current Section. Usage: select desired Section to add *yymmdd* before running macro. If Page already starts with 20** or 18** then that note will be skipped. If Page does not have the title: the first line will become the title -> trick: don't bother naming your note. Just type the first line with your intended title. Then run this macro once after every while.
BP: Delegate v2
This macro adds the Delegated tag to the page where the cursor is
Link Text on Page to Page Titles in Selected Section
Macro that allows you to link text on a page to a selected section's pages with matching page names
BP: Delegate
This macro adds the Delegated tag to the current page title
Insert YYYYMMDD - Long Date as Title
Insert YYYYMMDD - Long Date as Title, eg ... 20210913 - Monday, 13 September 2021 (based on other macros, thanks to Insert ISO yyyymmdd - at the beginning of the page and insert long date macros)
Add icon to all meetings
This macro will change the title of each page in the current section to add a meeting emoji to the beginning (unless it already has one). This has been made specifically for meetings sent to OneNote from Outlook. Great from seeing all meetings in a section at a glance.
BP: Deleted v2
This macro sets the deleted tag on the subpage where the cursor is located
Add Collmex Link
Creates a link to collmex customer from selected text. Collmex is a german ERP cloud solution at www.collmex.de. How to use: Adjust your own collmex number. Then start using: Every of your customer gets a unique number. Just type this number, select the number and this macro will insert a link to this specific customer.
AddCCRLInkToSelectedText
Add CCR hyperlink to selected text. Selecting "12345" and invoking macro creates the link: http://ccms.cadence.com/cqweb/#/Production/CCMPR/RECORD/CCMPR12345
Convert "LN, FN" to "FN LN" in Meeting Notes
In meeting notes if there are attendees in the format "LastName, FirstName", this macro converts them to "FirstName LastName" format.
Set Highlight Color (random from list or select your own)
Set your text highlight color to random color from a pre-defined list. You can adjust the list by editing the macro. You can select your own color if the random highlight color doesn't suit your need.
Insert MM/DD/YYYY
Insert MM/DD/YYYY. Modified by M.A. Abril. Original macro by alarsen: https://getonetastic.com/macroland&id=243A75607F3B5F7E89B7A4891525E57E
Take Images out of Text Box
Some Macros will not work when an Image is in a Text Box. (ie. Moving, setting as background, etc.) This Macro takes all images in Text Boxes and copies them so that they are no longer in a text box. Maintains approximate position on page
Set Font Color (random from list or select your own)
Set your text font color to random color from a pre-defined list. You can adjust the list by editing the macro. You can select your own color if the random color doesn't suit your need. The macro is set to automatically make your text bold, you can disable it from the macro code.
Outlook Meeting Date Stamp
This macro will change the creation date of each page in the current section with the time of the meeting, if the page contains meeting notes, allowing them to be sorted by the meeting date. This has been made specifically for meetings sent to OneNote from Outlook.
Resize and Space Selected Images
This macro resizes and arranges images on the current OneNote page. You can specify the width and height as a percentage of the original size, and optionally add vertical spacing (in pixels) between each image. Additionally, you can choose to apply the changes only to selected images.
Crosslink paragraphs
After using "Add current paragraph link to currently selected text", copy that text to another paragraph or page, then use this macro to crosslink those paragraphs. Great for creating Index pages.
Copy link to paragraph
Following a change in behavior introduced in OneNote for Microsoft 365 (version 2505+, June 2025), the built-in "Copy Link to Paragraph" now produces only web links to entire pages instead of internal links to specific paragraphs in the desktop app. This macro restores the classic functionality of copying a true onenote:// link to the selected paragraph in your clipboard, making it easy to create precise internal references as before. Simply run the macro, then paste the resulting link anywhere you need direct navigation to your chosen paragraph.
Show Image Size in Pixels
This macro shows the width and height (in pixels) of the selected image on the current OneNote page. If no image is selected, it will show an error message.
ESP_Insert dated page at top
SImple macro to insert a new page at the top of the open section and insert the date at the start of the page title
See All Macros