Skip to main content

SetSubject

Sets the document subject.

Syntax

expression.SetSubject(sSubject);

expression - A variable that represents a ApiCore class.

Parameters

NameRequired/OptionalData typeDefaultDescription
sSubjectRequiredstringThe document subject.

Returns

This method doesn't return any data.

Example

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

const doc = Api.GetDocument();
const core = doc.GetCore();
core.SetSubject("ApiCore Method Showcase");

const subject = core.GetSubject();
let paragraph = doc.GetElement(0);
paragraph.AddText("Subject: " + subject);