User Guide

476
OLE Automation Object Reference
OLE Automation Object Reference
"
Professional and Enterprise Editions only. The Macro Editor is not available
in the Visual Studio integrated editor.
This section lists the OLE Automation objects you can use in a macro to automate Wise
for Windows Installer. Each object is briefly described and followed by a table. Most
tables include: child of, properties, and methods.
Also see OLE Automation Function Reference on page 460.
WColumn
This is a single column for a row.
VBScript Example (lines are numbered for clarity):
1. ' create a new row and copy the data from an existing row.
2. ' assume tblControl is assigned to the Control table.
3. ' assume rowBase is a row to copy in the Control table.
4. Dim rowNew As Wrow
5. Dim col As WColumn
6. ' create row, but don't add it to table.
7. Set rowNew = tblControl.NewWRow(FALSE)
8. ' iterate all columns of the row.
9. For i = 0 To rowBase.WColumns.Count - 1
10. col = rowNew.WColumns(i)
11. ' copy data from base row to new row.
12. col.Data = rowBase.WColumns(i).Data
13. Next
VBScript Example (lines are numbered for clarity):
1. Set tbl = WTables("Binary")
2. ' get side16 row
3. Set row = tbl.WRows.Row("side16")
4. ' get the data column
5. Set col = row("Data")
6. ' read bitmap from c:\g.bmp and create a link
7. col.AccessBinaryData 0,"C:\side16.bmp",TRUE
Child of WColumns
Properties Data: default property to get and set data for the column
BSTR Name: Name of the column
Methods AccessBinaryData(BinaryReadWrite bdWrite,BSTR filePath,BOOLEAN bLink):
bdWrite - 1 is write to file, 0 is read from file (there are enumerations bdWriteToFile and
bdReadFromFile
filePath - path to file to read/write data from/to
bLink - add an entry to scan this file at compile time to update the binary data if this file has
changed