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

Using binary data

Sorting objects

Macro menus

Bulleted and numbered lists

Sample Macros

Concepts

Expressions

Objects

Properties

Variables

Data Types

Arrays

Functions

Literals

Operators

Comments

Last updated on: March 19, 2023
Also available as a single HTML file

Onetastic Macro Documentation > Functions > Window Functions > Window_NavigateTo

Window_NavigateTo

Navigates the given window to the provided location. The location can be a hierarchy object, id of a hierarchy object, or a "onenote:" URL. OneNote may display UI while navigation is under way. This function returns true if the navigation is successful or false if the location is not found or navigation is cancelled by the user.

Syntax

Bool Window_NavigateTo(
	Window window, 
	Mixed location)

Parameters

Window window
The window to navigate to.
Mixed location
The location to navigate to. Expected types are: Notebook, SectionGroup, Section, Page, or a String for id of one of those objects or a URL that starts with "onenote:". Navigating to URLs are slower than navigating with an object or object id.

Examples

// Navigate the current window to the first page in the current section $window = Window_GetCurrent() // Find the first page $page = GetCurrentSection().pages[0] // All three below will do the same thing Window_NavigateTo($window, $page) Window_NavigateTo($window, $page.id) Window_NavigateTo($window, $page.hyperlink)

Reference

Statements

For

ForEach

If

Else If

Else

Switch

Case

Default

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

MacroMenu

Window

Functions

Array Functions

Color Functions

Data Store Functions

Date/Time Functions

Dialog Box Functions

Macro Execution Functions

Macro Menu Functions

Object Functions

String Functions

Window Functions