Shape
This topic describes the API operations that are related to the shapes in presentation documents.
Shapes
ActivePresentation.SlideShowWindow.View.Slide.Shapes
Returns a collection of all Shape objects on a slide.
Only IMM WebOffice SDK for JavaScript V1.1.10 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapesexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Return a collection of all Shape objects on a slide. const shapes = await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes; }
Methods
ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddPicture()
Adds a picture to the active slide.
Only IMM WebOffice SDK for JavaScript V1.1.10 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddPicture({ FileName, LinkToFile, SaveWithDocument, Left, Top, Width, Height, Scale })expression: an Application object.
Parameters
Name
Data type
Required
Description
FileName
String
Yes
The picture. The picture can be specified by using a Blob file or a URL.
LinkToFile
Enum
Yes
Specifies whether to link the picture to the file from which the picture was created. For more information, see MsoTriState.
SaveWithDocument
Enum
Yes
Specifies whether to save the picture with the document. If you set
LinkToFiletomsoFalse, the value of this parameter must bemsoTrue. For more information, see MsoTriState.Left
Number
Yes
The position of the left edge of the picture relative to the left edge of the slide. The position is represented as a ratio, with valid values ranging from 0 to 1.
NoteIf the value is less than 0 or greater than 1, the picture is positioned outside the slide.
Top
Number
Yes
The position of the top edge of the picture relative to the top edge of the slide. The position is represented as a ratio, with valid values ranging from 0 to 1.
NoteIf the value is less than 0 or greater than 1, the picture is positioned outside the slide.
Width
Number
No
The width of the picture. The width is represented as a ratio, with a default value of 1, which indicates the original width.
Height
Number
No
The height of the picture. The height is represented as a ratio, with a default value of 1, which indicates the original height.
Scale
Boolean
No
Specifies whether to calculate the width, height, and coordinates of the picture based on the scale of the slide. Valid values:
false (default value)
true
Example
async function example() { await instance.ready(); const app = instance.Application; // Add a picture to the active slide. await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddPicture({ FileName: 'https://image.developer.aliyundoc.com/storage/000000003682-2-tps-799-531.png', LinkToFile: -1, SaveWithDocument: 0, Left: 0.1, Top: 0.1, Width: 0.3, Height: 0.3, Scale: true, }); }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddMediaObject()
Inserts a media object.
Only IMM WebOffice SDK for JavaScript V1.1.14 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddMediaObject({ Type, FileName, File, Url, LinkToFile, Left, Top, Width, Height })expression: an Application object.
Parameters
Name
Data type
Required
Description
Type
StringYes
The media file type: Valid values: 'audio' and 'video'
FileName
StringYes
The media file name.
File
ObjectNo
The file in which you want to create an Object Linking and Embedding (OLE) object. It can be a Blob or File object.
Url
StringNo
The URL of the file. Base64-encoding URLs are supported.
LinkToFile
EnumYes
Specifies whether to link the media file to the file from which it was created. For more information, see MsoTriState.
Left
NumberNo
The position of the left edge of the object relative to the left edge of the slide.
Top
NumberNo
The position of the top edge of the object relative to the top edge of the slide.
Width
NumberNo
The width of the object.
Height
NumberNo
The height of the object.
async function example() { await instance.ready(); const app = instance.Application; // Insert a video into the active presentation file. await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddMediaObject({ Type: 'video', FileName: 'audio.mp4', Url: 'https://res1.wpsacdm.cache.wpscdn.cn/videos/57da3d14aee8307bab5fa529503adba4-min.mp4', // A video from WPS learning LinkToFile: 0, Left: 100, Top: 200, Width: 300, Height: 300, }); }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox()
Creates a text box.
Only IMM WebOffice SDK for JavaScript V1.1.10 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox({ Orientation, Left, Top, Width, Height, Color, Size, Scale, Bold, Italic, StrikeThrough, AlignMode })expression: an Application object.
Parameters
Name
Data type
Required
Description
Orientation
Enum
Yes
The text orientation. For more information, see MsoTriState.
Left
Number
Yes
The position of the left edge of the text box relative to the left edge of the slide. The position is represented as a ratio, with valid values ranging from 0 to 1.
NoteIf the value is less than 0 or greater than 1, the text box is positioned outside the slide.
Top
Number
Yes
The position of the top edge of the text box relative to the top edge of the slide. The position is represented as a ratio, with valid values ranging from 0 to 1.
NoteIf the value is less than 0 or greater than 1, the text box is positioned outside the slide.
Width
Number
No
The width of the text box. The width is represented as a ratio. Default value: 0.05
Height
Number
No
The height of the text box. The height is represented as a ratio. Default value: 0.25
Color
String
No
The color of the text. The default value is #000000, which indicates black color.
Size
Number
No
The size of the text font. Default value: 18
Scale
Boolean
No
Specifies whether to automatically extend the width of the text box. Valid values:
false (default value)
true
Bold
Boolean
No
Specifies whether to display the text in bold. Valid values:
false (default value)
true
Italic
Boolean
No
Specifies whether to display the text in italics. Valid values:
false (default value)
true
StrikeThrough
Boolean
No
Specifies whether to apply a strike-through effect to the text. Valid values:
false (default value)
true
AlignMode
Number
No
The text alignment. Valid values:
1: Left alignment. This is the default value.
2: Center alignment.
3: Right alignment.
4: Justify alignment.
5: Distributed alignment.
Return value
Returns a Shape object that represents the new text box.
Example
async function example() { await instance.ready(); const app = instance.Application; // Create a text box. const textBox = await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox({ Orientation: 0, Left: 0.1, Top: 0.1, Width: 0.1, Height: 0.1, Color: '#f00', Size: 36, Scale: true }); textBox.TextFrame.TextRange.Text = '1245'; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.ReplacePicture()
Replaces the selected picture on a slide.
Only IMM WebOffice SDK for JavaScript V1.1.10 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.ReplacePicture({ FileName, IsKeepShapeSize })expression: an Application object.
Parameters
Name
Data type
Required
Description
FileName
String/Object
Yes
The source of the new picture. The source can be a Blob file or a URL.
IsKeepShapeSize
Boolean
No
Specifies whether to retain the aspect ratio of the source picture. Valid values:
true: The aspect ratio of the source picture is retained.
false: The width and height of the source picture are changed based on the aspect ratio of the selected picture.
Example
async function example() { await instance.ready(); const app = instance.Application; // Replace the selected picture on the slide. await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.ReplacePicture({ FileName: 'https://img8.file.cache.docer.com/storage/1626952237972828328/0e7c3a748ed2d065749b9659f54b679e.jpeg', // A picture from Docer. IsKeepShapeSize: true, }); }
Shape
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item()
Obtains a single object in the drawing layer, such as an AutoShape, freeform, OLE object, or picture.
Only IMM WebOffice SDK for JavaScript V1.1.10 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Itemexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain a single object in the drawing layer, such as an AutoShape, freeform, OLE object, or picture. const shape =await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1); }
Properties
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).ActionSettings
Returns a collection of action settings for a Shape object.
Only IMM WebOffice SDK for JavaScript V1.1.14 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).ActionSettingsexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain a collection of action settings for a Shape object. const ActionSettings =await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).ActionSettings; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).AutoShapeType
Sets or returns the shape type for a Shape or ShapeRange object.
Only IMM WebOffice SDK for JavaScript V1.1.14 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).AutoShapeTypeexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the shape type for a Shape or ShapeRange object. const AutoShapeType =await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).AutoShapeType; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Fill
Obtains the fill formatting properties.
Only IMM WebOffice SDK for JavaScript V1.1.14 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Fillexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the fill formatting properties for a Shape object. const Fill =await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Fill; }
ActivePresentation.SlideMaster.Background.Fill.Transparency
Returns or sets the degree of transparency of filling.
Syntax
expression.ActivePresentation.SlideMaster.Background.Fill.Transparencyexpression: an Application object.
Valid values for
Transparency: 0 to 1. If you specify0, the background is completely transparent. If you specify1, the background is completely opaque.Example
//@file=base.pptx async function example() { await instance.ready(); const app = instance.Application; // Specify the degree of transparency. app.ActivePresentation.SlideMaster.Background.Fill.Transparency = 0.5; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Fill.Visible
Returns or sets whether the filling is visible.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Fill.Visibleexpression: an Application object.
Example
//@file=base.pptx async function example() { await instance.ready(); const app = instance.Application; // Query whether the filling is visible. await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Fill.Visible; // Specify whether the filling is visible. app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Fill.Visible = true; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Fill.BackColor
Returns or sets the background color of the filling.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Fill.BackColorexpression: an Application object.
Example
//@file=base.pptx async function example() { await instance.ready(); const app = instance.Application; // Query the background color. await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Fill.BackColor.RGB; // Specify the background color. app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Fill.BackColor = '#ff0000'; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Fill.ForeColor
Returns or sets the foreground color.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Fill.ForeColorexpression: an Application object.
Example
//@file=base.pptx async function example() { await instance.ready(); const app = instance.Application; // Query the foreground color. await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Fill.ForeColor.RGB; // Set the foreground color. app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Fill.ForeColor = '#ff0000'; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Fill.Type
Returns the type of filling.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Fill.Typeexpression: an Application object.
Example
//@file=base.pptx async function example() { await instance.ready(); const app = instance.Application; // Query the type of filling. await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Fill.Type; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Line
Returns line formatting for a shape.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Lineexpression: an Application object.
Example
//@file=base.pptx async function example() { await instance.ready(); const app = instance.Application; // Query line formatting. const lineFormat = await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Line; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Line.Transparency
Returns or sets the transparency property of the line.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Line.Transparencyexpression: an Application object.
Valid values for
Transparency:0 to 1. If you specify0, the borderline is completely opaque. If you specify1, the borderline is completely transparent.Example
//@file=base.pptx async function example() { await instance.ready(); const app = instance.Application; // Query transparency. await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Line.Transparency; // Specify transparency. app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Line.Transparency = 0.5; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Line.Visible
Returns or sets whether the borderline is visible.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Line.Visibleexpression: an Application object.
Example
//@file=base.pptx async function example() { await instance.ready(); const app = instance.Application; // Query whether the borderline is visible. await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Line.Visible; // Specify whether the borderline is visible. app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Line.Visible = true; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Line.BackColor
Returns or sets the background color of the borderline.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Line.BackColorexpression: an Application object.
Example
//@file=base.pptx async function example() { await instance.ready(); const app = instance.Application; // Query the background color of the borderline. await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Line.BackColor.RGB // Specify the background color of the borderline. app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Line.BackColor = '#ff0000'; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Line.Style
Returns or sets the style of the borderline.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Line.Styleexpression: an Application object.
Example
//@file=base.pptx async function example() { await instance.ready(); const app = instance.Application; // Query the style of the borderline. await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Line.Style; // Specify the style of the borderline. app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Line.Style = await app.Enum.MsoLineStyle.msoLineThickThin; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Line.DashStyle
Returns or sets the dash style for the borderline.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Line.DashStyleexpression: an Application object.
Example
//@file=base.pptx async function example() { await instance.ready(); const app = instance.Application; // Query the dash style for the borderline. await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Line.DashStyle; // Specify the dash style of the borderline. app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Line.DashStyle = await app.Enum.MsoLineDashStyle.msoLineDashDot; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Glow
Returns the glow style of a Shape object.
Only IMM WebOffice SDK for JavaScript V1.1.14 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Glowexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the glow format of the specified Shape object. const Glow = app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Glow; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).TextFrame
Returns a text frame for a Shape object. The text frame contains the text in the text frame and the properties and methods that control the alignment and anchoring of the text frame.
Only IMM WebOffice SDK for JavaScript V1.1.14 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).TextFrameexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain a text frame for a Shape object. The text frame contains the text in the text frame and the properties and methods that control the alignment and anchoring of the text frame. const TextFrame = app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).TextFrame; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).HasTextFrame
Checks whether a Shape object contains a text frame.
Only IMM WebOffice SDK for JavaScript V1.1.14 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).HasTextFrameexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Check whether the specified Shape object contains a text frame. const HasTextFrame = app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).HasTextFrame; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Height
Returns the height of a Shape object.
Only IMM WebOffice SDK for JavaScript V1.1.14 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Heightexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the height of the specified Shape object. const Height = app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Height; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Width
Returns the width of a Shape object.
Only IMM WebOffice SDK for JavaScript V1.1.14 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Widthexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the width of the specified Shape object. const Width = app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Width; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Top
Returns or sets the distance from the top edge of the bounding box of a shape to the top edge of the slide.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Topexpression: an Application object.
Example
//@file=base.pptx async function example() { await instance.ready(); const app = instance.Application; // Return or set the distance from the top edge of the bounding box of the shape to the top edge of the slide. const Top = await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Top; app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Top = 10; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Left
Returns the distance from the left edge of the bounding box of a shape to the left edge of the slide.
Only IMM WebOffice SDK for JavaScript V1.1.14 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Leftexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the distance from the left edge of the bounding box of the shape to the left edge of the slide. const Left = app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Left; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Rotation
Returns the angle of rotation around the z-axis for a Shape object.
Only IMM WebOffice SDK for JavaScript V1.1.14 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Rotationexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Retrieve the angle of rotation around the z-axis for a Shape object. const Rotation = app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Rotation; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Tags
Returns a Tags object that represents the tags for a Shape object.
Only IMM WebOffice SDK for JavaScript V1.1.14 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Tagsexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain a Tags object that represents the tags for the specified Shape object. const Tags = app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Tags; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Type
Returns the type of a single Shape object or the types of multiple Shape objects within a ShapeRange.
Only IMM WebOffice SDK for JavaScript V1.1.14 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Typeexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the type of a single Shape object. const Type = app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Type; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Shadow
Returns the shadow formatting properties of a Shape object.
Only IMM WebOffice SDK for JavaScript V1.1.14 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(Index).Shadowexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the shadow formatting properties for the specified Shape object. const Shadow = app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).Shadow; }
ShapeRange
ActiveWindow.Selection.ShapeRange
Returns a collection of Shape objects in the selection.
Only IMM WebOffice SDK for JavaScript V1.1.14 and later support this feature.
Syntax
expression.ActiveWindow.Selection.ShapeRangeexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the presentation object. const presentation = await app.ActiveWindow.Selection; // Obtain a collection of Shape objects in the selection. const view = await presentation.ShapeRange; }
Methods
ActiveWindow.Selection.ShapeRange.Item()
Return a Shape object.
Only IMM WebOffice SDK for JavaScript V1.1.14 and later support this feature.
Syntax
expression.ActiveWindow.Selection.ShapeRange.Item(Index)expression: an Application object.
Parameters
Name
Data type
Required
Description
Index
Number
Yes
The index number of the Shape object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the presentation object. const presentation = await app.ActiveWindow.Selection; // Obtain a collection of Shape objects in the selection. const view = await presentation.ShapeRange; // Obtain a single Shape object in the selection. await app.ActiveWindow.Selection.ShapeRange.Item(1); }
Properties
ActiveWindow.Selection.ShapeRange.Count
Returns the number of Shape objects in the selection.
Only IMM WebOffice SDK for JavaScript V1.1.14 and later support this feature.
Syntax
expression.ActiveWindow.Selection.ShapeRange.Countexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the presentation object. const presentation = await app.ActiveWindow.Selection; // Obtain a collection of Shape objects in the selection. const view = await presentation.ShapeRange; // Obtain the number of Shape objects in the selection. const count = await app.ActiveWindow.Selection.ShapeRange.Count console.log(count); }
TextFrame
ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().TextFrame
Returns the text frame for a Shape object. The text frame contains the text in the text frame and the properties and methods that control the alignment and anchoring of the text frame.
Only IMM WebOffice SDK for JavaScript V1.1.10 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().TextFrameexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain a text frame for a Shape object. The text frame contains the text in the text frame and the properties and methods that control the alignment and anchoring of the text frame. const TextFrame = app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).TextFrame; }
TextRange
ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().TextFrame.TextRange
Obtains the text that is attached to a Shape object, and properties and methods that manipulate the text.
Only IMM WebOffice SDK for JavaScript V1.1.10 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().TextFrame.TextRangeexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the text that is attached to a Shape object, and properties and methods for manipulating the text. const TextRange = app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().TextFrame.TextRange; }
Properties
ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().TextFrame.TextRange.Text
Sets the text that is contained in a Shape object.
Only IMM WebOffice SDK for JavaScript V1.1.10 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().TextFrame.TextRange.Textexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Set the text that is contained in a Shape object. app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().TextFrame.TextRange.Text = 'Aliyun'; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(index).TextFrame.TextRange.Font
Returns a Font object that represents text formatting for the specified TextRange object.
Only IMM WebOffice SDK for JavaScript V1.1.14 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(index).TextFrame.GetTextRange(Begin,End).Fontexpression: an Application object.
Name
Data type
Required
Description
Begin
Number
Yes
The start of the text range.
End
Number
Yes
The end of the text range.
Example
async function example() { await instance.ready(); const app = instance.Application; // Return a Font object within the specified range, which contains the text attributes of the specified text. const Font = app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).TextFrame.GetTextRang(1,2).Font; }
ActionSettings
ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().ActionSettings
Returns a collection that contains two ActionSetting objects.
Only IMM WebOffice SDK for JavaScript V1.1.10 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().ActionSettingsexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain a collection that contains two ActionSetting objects. const ActionSettings = await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().ActionSettings; }
Methods
ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().ActionSettings.Item()
Returns a single action setting from the specified ActionSettings collection.
Only IMM WebOffice SDK for JavaScript V1.1.10 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().ActionSettings.Item(Index)expression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain a single action setting from the specified ActionSettings collection. const ActionSetting = await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().ActionSettings.Item(1); }
ActionSetting
ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().ActionSettings.Item()
Returns an ActionSettings object that holds information about actions performed when the user clicks or moves the mouse over the specified Shape or TexRange object during a slide show.
Only IMM WebOffice SDK for JavaScript V1.1.10 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().ActionSettings.Item(Index)expression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain information about how to respond to mouse operations on a Shape object or a TextRange object during a slide show. const ActionSetting = await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().ActionSettings.Item(1); }
Properties
ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().ActionSettings.Item().Hyperlink
Returns a Hyperlink object that represents the hyperlink for the specified Shape object. This property is read-only.
Only IMM WebOffice SDK for JavaScript V1.1.10 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().ActionSettings.Item(Index).Hyperlinkexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Return a Hyperlink object that represents the hyperlink for the specified Shape object. This property is read-only. const ActionSetting = await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().ActionSettings.Item(1).Hyperlink; }
Hyperlink
ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().ActionSettings.Item(Index).Hyperlink
Returns the hyperlink for a Shape object.
Only IMM WebOffice SDK for JavaScript V1.1.10 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().ActionSettings.Item(Index).Hyperlinkexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the hyperlink for a Shape object. const ActionSetting = await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().ActionSettings.Item(1).Hyperlink; }
Properties
ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().ActionSettings.Item(Index).Hyperlink.TextToDisplay
Sets or returns the display text for a hyperlink that is not associated with a shape.
Only IMM WebOffice SDK for JavaScript V1.1.10 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().ActionSettings.Item(Index).Hyperlink.TextToDisplayexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Create a text box. const textBox = await app.Application.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox({ Orientation: -1, Left: 0.3, Top: 0.3, Width: 100, Height: 30, Color: '#ff0', Size: 24, Scale: false, }); // Specify the display text. textBox.ActionSettings(1).Hyperlink.TextToDisplay = 'Alibaba Cloud Knowledge Base'; // Set the hyperlink. textBox.ActionSettings(1).Hyperlink.Address = 'https://example.aliyundoc.com/docs'; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().ActionSettings.Item(Index).Hyperlink.Address
Sets or returns the hyperlink address of a Shape object.
Only IMM WebOffice SDK for JavaScript V1.1.10 and later support this feature.
Syntax
expression.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().ActionSettings.Item(Index).Hyperlink.Addressexpression: an Application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Create a text box. const textBox = await app.Application.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox({ Orientation: -1, Left: 0.3, Top: 0.3, Width: 100, Height: 30, Color: '#ff0', Size: 24, Scale: false, }); // Specify the display text. textBox.ActionSettings(1).Hyperlink.TextToDisplay = 'Aliyun'; // Set the hyperlink. textBox.ActionSettings(1).Hyperlink.Address = 'https://example.aliyundoc.com/docs'; // Obtain the hyperlink address. const address = await app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.AddTextbox().ActionSettings.Item(1).Hyperlink.Address }