Tutorial

Getting Started with Macros

Macro Editor

User Interface

Menus and Toolbar

Editing Macros

Macro Debugging

How To

Using variables

Finding and modifying objects

Creating new page content

Asking for user input

Storing persistent data

Using binary data

Sorting objects

Macro menus

Bulleted and numbered lists

Accessing the file system

Sample Macros

Concepts

Expressions

Objects

Properties

Variables

Data Types

Arrays

Functions

Literals

Operators

Comments

Last updated on: April 20, 2025
Also available as a single HTML file

Onetastic Macro Documentation > Page Objects > HtmlBlock

HtmlBlock Object

Description

Represents a block of HTML to be inserted in a OneNote page.

Remarks

HtmlBlocks can be inserted into Outline and Cell objects as a quick way to insert page content. Rather than creating OneNote page object structure (Paragraphs, Tables, Rows, Cells, etc.) you can insert an HtmlBlock with HTML content. When the page is saved, either at the end of the macro or via SaveChanges function, the HTML content will be converted to OneNote objects.

Properties

Name Type Access Description
indent Numeric read-write The indent amount for this HtmlBlock, relative to its parent Outline or Cell. An unindented HtmlBlock has an indent of 0.
value String|File read-write The HTML content to be inserted. If a string is assigned to this property, then it contains the actual HTML content. If a File is assigned to this property then it points to a file that has the HTML content. To create File objects to assign to this property, use File System Functions like FileSystem_FileFromPath or FileSystem_ShowOpenFileDialog.

Reference

Statements

Hierarchy Objects

Page Objects

Other Objects

Functions

Array Functions

Clipboard Functions

Data Store Functions

Data Type Specific Functions

Date/Time Functions

Dialog Box Functions

File System Functions

Macro Execution Functions

Macro Menu Functions

Object Functions

Special Functions

String Functions

Window Functions