Share via


ShapeRange.Script Property

Returns a Script object that represents a block of script code on a Microsoft Office PowerPoint slide. Read-only.

Namespace:  Microsoft.Office.Interop.PowerPoint
Assembly:  Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)

Syntax

'Declaration
ReadOnly Property Script As Script
    Get
'Usage
Dim instance As ShapeRange
Dim value As Script

value = instance.Script
Script Script { get; }

Property Value

Type: Microsoft.Office.Core.Script
Script

Remarks

In PowerPoint, script is associated with an anchor shape. If no script is associated with the specified shape, the Script property returns nothing.

Script code inserted on a slide can only be run in Web presentations.

By default, script anchor shapes are not visible. To make them visible, use the PowerPoint user interface. You cannot make script anchor shapes visible with Visual Basic code.

It is possible to use the Script property on a range of shapes (ShapeRange.Script) instead of specifying a single anchor shape. However, if the range contains more than one shape, your code will not work and will return a message that indicates the Script property cannot be accessed.

Examples

This example sets the scripting language for the script anchor (shape eight on slide one) to Microsoft Visual Basic Scripting Edition (VBScript).

With ActivePresentation.Slides(1).Shapes(8)

    .Script.Language = msoScriptLanguageVisualBasic

End With

See Also

Reference

ShapeRange Interface

ShapeRange Members

Microsoft.Office.Interop.PowerPoint Namespace