本文介绍与演示文稿Font相关的API。
Font
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(index).TextFrame.GetTextRange(Begin,End).Font
代表文字的文字属性。
JS-SDK V1.1.14及以上版本支持此功能。
语法
表达式.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(index).TextFrame.GetTextRange(Begin,End).Font
表达式:文档类型应用对象。
参数
属性
数据类型
默认值
必填
说明
Begin
Number
是
文字开始位置
End
Number
是
文字结束位置
示例
async function example() { await instance.ready(); const app = instance.Application; // 返回一个指定范围内的 Font 对象,该对象包含了指定文字的文字属性 const Font = app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).TextFrame.GetTextRang(1,2).Font; }
属性
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(index).TextFrame.GetTextRange(Begin,End).Font.Bold
获取加粗。
JS-SDK V1.1.14及以上版本支持此功能。
语法
表达式.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(index).TextFrame.GetTextRange(Begin,End).Font.Bold
表达式:文档类型应用对象。
参数
属性
数据类型
必填
说明
Begin
Number
是
文字开始位置
End
Number
是
文字结束位置
示例
async function example() { await instance.ready(); const app = instance.Application; // 获取加粗 const Bold = app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).TextFrame.GetTextRang(1,2).Font.Bold; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(index).TextFrame.GetTextRange(Begin,End).Font.Italic
获取斜体
JS-SDK V1.1.14及以上版本支持此功能。
语法
表达式.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(index).TextFrame.GetTextRange(Begin,End).Font.Italic
表达式:文档类型应用对象。
参数
属性
数据类型
必填
说明
Begin
Number
是
文字开始位置
End
Number
是
文字结束位置
示例
async function example() { await instance.ready(); const app = instance.Application; // 获取斜体 const Italic = app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).TextFrame.GetTextRang(1,2).Font.Italic; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(index).TextFrame.GetTextRange(Begin,End).Font.Name
获取字体。
JS-SDK V1.1.14及以上版本支持此功能。
语法
表达式.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(index).TextFrame.GetTextRange(Begin,End).Font
表达式:文档类型应用对象。
参数
属性
数据类型
必填
说明
Begin
Number
是
文字开始位置
End
Number
是
文字结束位置
示例
async function example() { await instance.ready(); const app = instance.Application; // 获取字体名称 const Name = app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).TextFrame.GetTextRang(1,2).Font.Name; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(index).TextFrame.GetTextRange(Begin,End).Font.Size
获取字号。
JS-SDK V1.1.14及以上版本支持此功能。
语法
表达式.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(index).TextFrame.GetTextRange(Begin,End).Font.Size
表达式:文档类型应用对象。
参数
属性
数据类型
必填
说明
Begin
Number
是
文字开始位置
End
Number
是
文字结束位置
示例
async function example() { await instance.ready(); const app = instance.Application; // 获取字号 const Size = app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).TextFrame.GetTextRang(1,2).Font.Size; }
ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(index).TextFrame.GetTextRange(Begin,End).Font.Underline
获取下划线。
JS-SDK V1.1.14及以上版本支持此功能。
语法
表达式.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(index).TextFrame.GetTextRange(Begin,End).Font.Underline
表达式:文档类型应用对象。
参数
属性
数据类型
必填
说明
Begin
Number
是
文字开始位置
End
Number
是
文字结束位置
示例
async function example() { await instance.ready(); const app = instance.Application; // 获取下划线 const Underline = app.ActivePresentation.SlideShowWindow.View.Slide.Shapes.Item(1).TextFrame.GetTextRang(1,2).Font.Underline; }