Tutorial

Getting Started with Macros

Macro Editor

User Interface

Menus and Toolbar

Editing Macro Statements

Expression Editor

Macro Debugging

How To

Using variables

Finding and modifying objects

Creating new page content

Asking for user input

Storing persistent data

Sorting objects

Sample Macros

Concepts

Expressions

Objects

Properties

Variables

Data Types

Arrays

Functions

Literals

Operators

Comments

InsertObject

Creates a new object and inserts it into OneNote hierarchy or into a OneNote page. Returns the newly created object.

Syntax

Object InsertObject(
	Object object, 
	ObjectType type, 
	Numeric position)

Parameters

Object object
Parent object to insert the new object into.
ObjectType type
The type of the new object to create and insert. Following types of objects can be inserted: SectionGroup (under a Notebook or a SectionGroup), Section (under a Notebook or a SectionGroup), Page (under a Section), Outline (under a Page), Paragraph (under an Outline or a Cell), Table (under an Outline or a Cell), Row (under a Table), Cell (under a Row), Text (under a Paragraph).
Numeric position
The position of the new object. The value is a 0 based index for the child collection or -1 to insert at the end.

Reference

Statements

ForEach

If

Else

While

Expression

Comment

Break

Continue

Return

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

Data Store Functions

Date/Time Functions

Dialog Box Functions

Macro Execution Functions

Object Functions

String Functions