User Guide

641
SPSS Scripting
Facility
Properties and Methods (Scripting)
Like real world objects, OLE automation objects have features and uses. In
programming terminology, the features are referred to as properties, and the uses are
referred to as methods. Each object class has specific methods and properties that
determine what you can do with that object.
Object Property Method
Pencil (real world) Hardness
Color
Write
Erase
Pivot tabl
e (SPSS)
TextFont
DataCellWidths
CaptionText
SelectTab
le
ClearSelection
HideFootnotes
Example: Using Properties (Scripting)
Properties set or return attributes of objects, such as color or cell width. When a
property appears to the left side of an equals sign, you are writing to it. For example,
to set the caption for an activated pivot table (
objPivotTable)to"Anita's
results"
:
objPivotTable.CaptionText = "Anita's results"
When a property appears on the right side, you are reading from it. For example, to
get the caption of the activated pivot table and save it in a variable:
strFontName = objPivotTable.CaptionText
Example: Using Methods (Scripting)
Methods perform actions on objects, such as selecting all the elements in a table:
objPivotTable.SelectTable