跳到主要内容

SetAppearance

Sets the visualization type of the content control.

Syntax

expression.SetAppearance(type);

expression - A variable that represents a ApiInlineLvlSdt class.

Parameters

NameRequired/OptionalData typeDefaultDescription
typeRequired"boundingBox" | "hidden"The desired visualization type.

Returns

This method doesn't return any data.

Example

This example adds a content control and changes its appearance.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
let contentControl = Api.CreateInlineLvlSdt();
contentControl.SetAppearance("hidden");
contentControl.AddText("This is a content control with a hidden appearance");
paragraph.Push(contentControl);