Scripts 接口

定义

表示指定文档中 HTML 脚本集合的 对象的集合 Script

public interface class Scripts : Microsoft::Office::Core::_IMsoDispObj, System::Collections::IEnumerable
[System.Runtime.InteropServices.Guid("000C0340-0000-0000-C000-000000000046")]
public interface Scripts : Microsoft.Office.Core._IMsoDispObj, System.Collections.IEnumerable
[<System.Runtime.InteropServices.Guid("000C0340-0000-0000-C000-000000000046")>]
type Scripts = interface
    interface _IMsoDispObj
    interface IEnumerable
Public Interface Scripts
Implements _IMsoDispObj, IEnumerable
属性
实现

注解

Scripts 集合包含给定文档中的所有 Script 对象,按源顺序 (将 Script 对象添加到源文件) 的顺序。 源顺序不受文档中脚本 (标题或正文文本) 位置的影响。 可以使用相应对象的 Scripts 属性访问 Scripts 集合, (例如 Microsoft Word) 中的 Document 对象。

可以使用 脚本 对象访问脚本或将脚本添加到 Microsoft Word 文档、Microsoft Excel 工作表或 Microsoft PowerPoint 幻灯片。 还可以使用 Scripts 集合访问在 Microsoft Office 应用程序中打开的任何 HTML 页面或脚本。

注意 Microsoft Access 不会使用此共享 Office 组件。

Script 对象添加到 Scripts 集合时,将自动将类型为 msoScriptAnchorShape 对象添加到文档。 在 Excel 工作表或 PowerPoint 幻灯片上,形状将添加到 Shapes 集合中;在 Word 文档中,形状将添加到 InlineShapes 集合中。 使用 Add(Object, MsoScriptLocation, MsoScriptLanguage, String, String, String) 方法将脚本添加到文档。

若要访问 Scripts 集合中的特定项,请使用 Item(Object) 方法并提供 SCRIPT> 标记的 <ID 属性或指示脚本在集合中位置的索引号。 ID 在文档中必须是唯一的。 如果 ID 属性重复,则返回找到的第一个具有该 ID 的脚本。

Count使用 属性确定指定文档中的 Script 对象数。

Delete()使用 方法从 Scripts 集合中删除脚本。

属性

Application

返回一个 Application 对象,该对象代表该对象的容器应用程序。

Count

返回一个 Integer 类型的值,该值指示指定集合中的项数。

Creator

返回一个 32 位整数,它指示在其中创建指定的对象的应用程序。

Parent

返回指定对象的 Parent 对象。

方法

Add(Object, MsoScriptLocation, MsoScriptLanguage, String, String, String)

Script将 对象添加到Scripts以下对象之一的集合:Microsoft Word 中的 DocumentRange 对象;Microsoft Excel 中的 WorksheetChart 对象;Microsoft PowerPoint 中的 SlideSlideRange、幻灯片母版或标题 Master 对象。

Delete()

从集合中删除指定的 对象。

GetEnumerator()

表示指定文档中 HTML 脚本集合的 对象的集合 Script

Item(Object)

返回集合的成员 Scripts

适用于