跳到主要内容

GetSubject

Returns the document subject.

Syntax

expression.GetSubject();

expression - A variable that represents a ApiCore class.

Parameters

This method doesn't have any parameters.

Returns

string

Example

This example demonstrates how to get 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);