Skip to main content

SetTitle

Sets the document title.

Syntax

expression.SetTitle(sTitle);

expression - A variable that represents a ApiCore class.

Parameters

NameRequired/OptionalData typeDefaultDescription
sTitleRequiredstringThe document title.

Returns

This method doesn't return any data.

Example

This example demonstrates how to set the title of the current document.

const doc = Api.GetDocument();
const core = doc.GetCore();
core.SetTitle("My Document Title");

const title = core.GetTitle();
let paragraph = doc.GetElement(0);
paragraph.AddText("Title: " + title);