Tutorial

Getting Started with Macros

Macro Editor

User Interface

Editing Macro Statements

Expression Editor

How To

Using variables

Finding and modifying objects

Creating new page content

Asking for user input

Sorting objects

Macro Logging

Sample Macros

Concepts

Expressions

Objects

Properties

Variables

Data Types

Arrays

Functions

Literals

Operators

Comments

Data Types

Following is the list of data types in macros. Properties can be of one of these data types and variables can be of one of the base types.

Base Types

Name Possible Values
Bool true, false
String Any text
Numeric Any positive or negative integral or floating point value or zero (0)
Date/Time This is the type of date/time related properties (e.g. createdTime, lastModifiedTime) in several objects. If converted to a string or used in a string context (as a parameter to String functions) it has the following format: YYYY-MM-DDTHH:MM:SS.000Z as specified here. Date/Time functions can be used to easily retrieve parts of this and convert them to user readable strings.
Array A set of values of any base type. See Arrays.
Object A OneNote object or a dialog box.

Restricted Types

Restricted types are String types that can only have one of a set of possible values.

Selection

Description
Type of the selection property in several objects. For objects that aren't selected, it will have a value of none, while for selected objects it will have a value of all or partial depending on how much of it is selected. For instance a partially selected paragraph will have a value of partial.
Possible Values
none, partial, all

SuperSub

Description
Type of the supersub property in Text and Paragraph objects. If the text is formatted as a superscript or subscript, then it will have a value of super or sub value, otherwise it will have a value of none.
Possible Values
none, super, sub

ContentType

Description
Type of the contentType property in Paragraph objects.
Possible Values
image, table, text, ink drawing, ink writing, embedded file, embedded media, unknown

Color

Description
Type of the color properties (e.g. fontColor, highlightColor) in several objects. When reading color values from objects, the value is returned in the canonical #rrggbb format or as automatic if no color was set.
Possible Values
6-digit hex color value (#rrggbb)
Color names like: black, blue, red, yellow etc.
automatic if no color was set (e.g. no highlightColor or the default fontColor).

ImageFormat

Description
Type of the format property in Image objects.
Possible Values
png, jpg, emf

Alignment

Description
Type of the alignment property in Paragraph objects.
Possible Values
left, center, right

Orientation

Description
Type of the orientation property in Page objects.
Possible Values
portrait, landscape

ObjectType

Description
Type of a OneNote object.
Possible Values
NotebookRoot, Notebook, SectionGroup, Section, Page, Title, Outline, Table Column, Row, Cell, Paragraph Text, Image, EmbeddedFile

Reference

Statements

ForEach

If

Else

While

Expression

Comment

Break

Continue

Hierarchy Objects

NotebookRoot

Notebook

SectionGroup

Section

Page

Page Objects

Title

Outline

Table

Column

Row

Cell

Paragraph

Text

Image

EmbeddedFile

Tag

Other Objects

DialogBox

Functions

Array Functions

Date/Time Functions

Dialog Box Functions

Macro Execution Functions

Object Functions

String Functions