CAWT Reference

::Cawt

Introduction

The Cawt namespace provides commands for basic automation functionality.

Commands

CentiMetersToPoints [::Cawt]

Cawt, Top

Convert centimeter value into points.

CentiMetersToPoints cm

Parameters
cm Floating point centimeter value to be converted to points.
Description

Convert centimeter value into points.

Return the corresponding value in points.

See also: SetDotsPerInch InchesToPoints

CheckList [::Cawt]

Cawt, Top

Check, if 2 lists are identical.

CheckList expected value msg printCheck

Parameters
expected Expected list.
value Test list.
msg Message for test case.
printCheck(optional, default true) Print message for successful test case.
Description

Check, if 2 lists are identical.

Return true, if both lists are identical. If "printCheck" is set to true, a line prepended with "Check:" and the message supplied in "msg" is printed to standard output. If the check fails, return false and print message prepended with "Error:".

CheckMatrix [::Cawt]

Cawt, Top

Check, if 2 matrices are identical.

CheckMatrix expected value msg printCheck

Parameters
expected Expected matrix.
value Test matrix.
msg Message for test case.
printCheck(optional, default true) Print message for successful test case.
Description

Check, if 2 matrices are identical.

Return true, if both matrices are identical. If "printCheck" is set to true, a line prepended with "Check:" and the message supplied in "msg" is printed to standard output. If the check fails, return false and print message prepended with "Error:".

CheckNumber [::Cawt]

Cawt, Top

Check, if 2 numerical values are identical.

CheckNumber expected value msg printCheck

Parameters
expected Expected numeric value.
value Test numeric value.
msg Message for test case.
printCheck(optional, default true) Print message for successful test case.
Description

Check, if 2 numerical values are identical.

Return true, if both numeric values are identical. If "printCheck" is set to true, a line prepended with "Check:" and the message supplied in "msg" is printed to standard output. If the check fails, return false and print message prepended with "Error:".

CheckString [::Cawt]

Cawt, Top

Check, if 2 string values are identical.

CheckString expected value msg printCheck

Parameters
expected Expected string value.
value Test string value.
msg Message for test case.
printCheck(optional, default true) Print message for successful test case.
Description

Check, if 2 string values are identical.

Return true, if both string values are identical. If "printCheck" is set to true, a line prepended with "Check:" and the message supplied in "msg" is printed to standard output. If the check fails, return false and print message prepended with "Error:".

ClipboardToImg [::Cawt]

Cawt, Top

Copy the clipboard content into a photo image.

ClipboardToImg

Description

Copy the clipboard content into a photo image.

The photo image identifier is returned, if the clipboard content could be read correctly. Otherwise an error is thrown.

Note: The image data in the clipboard must be in BMP format. Therefore it needs the Img extension. The image must be freed by the caller (image delete), if not needed anymore.

See also: ImgToClipboard

ColorToRgb [::Cawt]

Cawt, Top

Return an Office color number as a RGB color list.

ColorToRgb color

Parameters
color The Office color number
Description

Return an Office color number as a RGB color list.

The r, g and b values are returned as integers in the range 0 .. 255.

Return the color number as a list of r, b and b values.

See also: RgbToColor

Destroy [::Cawt]

Cawt, Top

Destroy one or all COM objects.

Destroy comObj

Parameters
comObj(optional, default ) The COM object to be destroyed.
Description

Destroy one or all COM objects.

If "comObj" is an empty string, all existing COM objects are destroyed. Otherwise only the specified COM object is destroyed.

Note: Twapi does not clean up generated COM object identifiers, so you have to put a call to Destroy at the end of your Cawt script. For further details about COM objects and their lifetime see the Twapi documentation.

GetActivePrinter [::Cawt]

Cawt, Top

Get the name of the active printer.

GetActivePrinter appId

Parameters
appId The application identifier.
Description

Get the name of the active printer.

Return the name of the active printer as a string.

GetApplicationId [::Cawt]

Cawt, Top

Get the application identifier of an Office component.

GetApplicationId componentId

Parameters
componentId The identifier of an Office component.
Description

Get the application identifier of an Office component.

Office components are Workbooks, Worksheets, ...

GetApplicationName [::Cawt]

Cawt, Top

Get the name of an Office application.

GetApplicationName appId

Parameters
appId The application identifier.
Description

Get the name of an Office application.

Return the name of the application as a string.

GetDotsPerInch [::Cawt]

Cawt, Top

Return the dots-per-inch value used for conversions.

GetDotsPerInch

Description

Return the dots-per-inch value used for conversions.

See also: SetDotsPerInch

GetInstallationPath [::Cawt]

Cawt, Top

Get the Office installation pathname.

GetInstallationPath appId

Parameters
appId The application identifier.
Description

Get the Office installation pathname.

Return the installation pathname as a string.

GetOrCreateApp [::Cawt]

Cawt, Top

Use or create an instance of an application.

GetOrCreateApp appName useExistingFirst

Parameters
appName The name of the application to be create or used.
useExistingFirst Prefer an already running application.
Description

Use or create an instance of an application.

Application names supported and tested with Cawt are: "Excel.Application", "PowerPoint.Application", "Word.Application", "GoogleEarth.ApplicationGE", "Matlab.Application". Note: There are higher level functions "Open" and "OpenNew" for the Cawt sub-packages.

If "useExistingFirst" is set to true, it is checked, if an application instance is already running. If true, this instance is used. If no running application is available, a new instance is started.

Return the application identifier.

See also: KillApp

GetPkgVersion [::Cawt]

Cawt, Top

Get the version of a Cawt sub-package.

GetPkgVersion pkgName

Parameters
pkgName The name of the sub-package
Description

Get the version of a Cawt sub-package.

The version is returned as a string.

See also: HavePkg

GetStartupPath [::Cawt]

Cawt, Top

Get the Office startup pathname.

GetStartupPath appId

Parameters
appId The application identifier.
Description

Get the Office startup pathname.

Return the startup pathname as a string.

GetTemplatesPath [::Cawt]

Cawt, Top

Get the Office templates pathname.

GetTemplatesPath appId

Parameters
appId The application identifier.
Description

Get the Office templates pathname.

Return the templates pathname as a string.

GetUserLibraryPath [::Cawt]

Cawt, Top

Get the Office user library pathname.

GetUserLibraryPath appId

Parameters
appId The application identifier.
Description

Get the Office user library pathname.

Return the user library pathname as a string.

GetUserName [::Cawt]

Cawt, Top

Get the name of the Office application user.

GetUserName appId

Parameters
appId The application identifier.
Description

Get the name of the Office application user.

Return the name of the application user as a string.

GetUserPath [::Cawt]

Cawt, Top

Get the Office user folder's pathname.

GetUserPath appId

Parameters
appId The application identifier.
Description

Get the Office user folder's pathname.

Return the user folder's pathname as a string.

HavePkg [::Cawt]

Cawt, Top

Check, if a Cawt sub-package is available.

HavePkg pkgName

Parameters
pkgName The name of the sub-package.
Description

Check, if a Cawt sub-package is available.

Return true, if sub-package pkgName was loaded successfully. Otherwise return false.

See also: GetPkgVersion

ImgToClipboard [::Cawt]

Cawt, Top

Copy a photo image into the clipboard.

ImgToClipboard phImg

Parameters
phImg The photo image identifier.
Description

Copy a photo image into the clipboard.

If the image could not be copied to the clipboard correctly, an error is thrown.

Note: The image data is copied to the clipboard in BMP format. Therefore it needs the Img and Base64 extensions.

See also: ClipboardToImg

InchesToPoints [::Cawt]

Cawt, Top

Convert inch value into points.

InchesToPoints inches

Parameters
inches Floating point inch value to be converted to points.
Description

Convert inch value into points.

Return the corresponding value in points.

See also: SetDotsPerInch CentiMetersToPoints

IsValidId [::Cawt]

Cawt, Top

Check, if a COM object is valid.

IsValidId comObj

Parameters
comObj The COM object.
Description

Check, if a COM object is valid.

Return true, if "comObj" is a valid object. Otherwise return false.

KillApp [::Cawt]

Cawt, Top

Kill all running instances of an application.

KillApp progName

Parameters
progName The application's program name, as shown in the task manager.
Description

Kill all running instances of an application.

No return value.

See also: GetOrCreateApp

RgbToColor [::Cawt]

Cawt, Top

Return a RGB color as an Office color number.

RgbToColor r g b

Parameters
r The red component of the color
g The green component of the color
b The blue component of the color
Description

Return a RGB color as an Office color number.

The r, g and b values are specified as integers in the range 0 .. 255.

Return the color number as an integer.

See also: ColorToRgb

SetDotsPerInch [::Cawt]

Cawt, Top

Set the dots-per-inch value used for conversions.

SetDotsPerInch dpi

Parameters
dpi Integer dpi value.
Description

Set the dots-per-inch value used for conversions.

If the dpi value is not explicitely set with this function, it's default value is 72.

No return value.

See also: GetDotsPerInch

ShowAlerts [::Cawt]

Cawt, Top

Toggle the display of Office alerts.

ShowAlerts appId onOff

Parameters
appId The application identifier.
onOff Switch the alerts on or off.
Description

Toggle the display of Office alerts.

No return value.

TclBool [::Cawt]

Cawt, Top

Cast a value to a boolean.

TclBool val

Parameters
val The value to be casted.
Description

Cast a value to a boolean.

Return true, if val is not equal to zero or true. Return false, if val is equal to zero or false.

See also: TclInt

TclInt [::Cawt]

Cawt, Top

Cast a value to an integer with boolean range.

TclInt val

Parameters
val The value to be casted.
Description

Cast a value to an integer with boolean range.

Return 1, if val is not equal to zero or true. Return 0, if val is equal to zero or false.

See also: TclBool

::Earth

Introduction

The Earth namespace provides commands to control Google Earth.

Commands

IsInitialized [::Earth]

Earth, Top

Check, if a GoogleEarth instance is initialized.

IsInitialized appId

Parameters
appId Identifier of the GoogleEarth instance.
Description

Check, if a GoogleEarth instance is initialized.

Return true or false dependent on the initialization status.

Open [::Earth]

Earth, Top

Open a GoogleEarth instance. Use an already running GoogleEarth, if available.

Open

Description

Open a GoogleEarth instance. Use an already running GoogleEarth, if available.

Return the identifier of the GoogleEarth application instance.

See also: OpenNew Quit

OpenNew [::Earth]

Earth, Top

Open a new GoogleEarth instance.

OpenNew

Description

Open a new GoogleEarth instance.

Return the identifier of the new GoogleEarth application instance.

See also: Open Quit

Quit [::Earth]

Earth, Top

Quit a GoogleEarth application instance.

Quit appId

Parameters
appId Identifier of the GoogleEarth instance.
Description

Quit a GoogleEarth application instance.

No return value.

See also: Open

SaveImage [::Earth]

Earth, Top

Save a grey-scale image of the current view.

SaveImage appId fileName quality

Parameters
appId Identifier of the GoogleEarth instance.
fileName Name of image file.
quality(optional, default 80) Quality of the JPEG compression in percent.
Description

Save a grey-scale image of the current view.

No return value.

SetCamera [::Earth]

Earth, Top

Set camera position and orientation.

SetCamera appId latitude longitude altitude elevation azimuth

Parameters
appId Identifier of the GoogleEarth instance.
latitude Latitude in degrees. Range [-90.0, 90.0].
longitude Longitude in degrees. Range [-180.0, 180.0].
altitude Altitude in meters.
elevation Elevation angle in degrees. Range [0.0, 90.0]. 0 degrees corresponds looking to the center of the earth. 90 degrees corresponds looking to the horizon.
azimuth Azimuth angle in degrees. Range [0.0, 360.0]. 0 degrees corresponds looking north. 90 degrees corresponds loooking east.
Description

Set camera position and orientation.

No return value.

::Excel

Introduction

The Excel namespace provides commands to control Microsoft Excel.

Commands

AddColumnChartSimple [::Excel]

Excel, Top

Add a clustered column chart to a worksheet. Simple case.

AddColumnChartSimple worksheetId numRows numCols title

Parameters
worksheetId Identifier of the worksheet.
numRows Number of rows beeing used for the chart.
numCols Number of columns beeing used for the chart.
title(optional, default ) String used as title of the chart.
Description

Add a clustered column chart to a worksheet. Simple case.

Data for the x-axis is taken from column 1, starting at row 2. Names for the lines are taken from row 1, starting at column 2. The data range for the "numCols" plots starts at (2, 2) and goes to (numRows+1, numCols+1).

Return the identifier of the added chart.

See also: CreateChart AddLineChart AddLineChartSimple AddPointChartSimple

AddLineChart [::Excel]

Excel, Top

Add a line chart to a worksheet. Generic case.

AddLineChart worksheetId headerRow xaxisCol startRow numRows startCol numCols title yaxisName markerSize

Parameters
worksheetId Identifier of the worksheet.
headerRow Row containing names for the lines.
xaxisCol Data for the x-axis is taken from this column.
startRow Starting row for data of x-axis.
numRows Number of rows used as data of x-axis.
startCol Column in header from which names start.
numCols Number of columns to use for the chart.
title(optional, default ) String used as title of the chart.
yaxisName(optional, default Values) Name of y-axis.
markerSize(optional, default 5) Size of marker.
Description

Add a line chart to a worksheet. Generic case.

The data range for the "numCols" lines starts at (startRow, startCol) and goes to (startRow+numRows-1, startCol+numCols-1).

Return the identifier of the added chart.

See also: CreateChart AddLineChartSimple AddPointChartSimple AddRadarChartSimple

AddLineChartSimple [::Excel]

Excel, Top

Add a line chart to a worksheet. Simple case.

AddLineChartSimple worksheetId numRows numCols title yaxisName markerSize

Parameters
worksheetId Identifier of the worksheet.
numRows Number of rows used as data of x-axis.
numCols Number of rows used as data of y-axis.
title(optional, default ) String used as title of the chart.
yaxisName(optional, default Values) Name of y-axis.
markerSize(optional, default 5) Size of marker.
Description

Add a line chart to a worksheet. Simple case.

Data for the x-axis is taken from column 1, starting at row 2. Names for the lines are taken from row 1, starting at column 2. The data range for the "numCols" lines starts at (2, 2) and goes to (numRows+1, numCols+1).

Return the identifier of the added chart.

See also: CreateChart AddLineChart AddPointChartSimple AddRadarChartSimple

AddPointChartSimple [::Excel]

Excel, Top

Add a point chart to a worksheet. Simple case.

AddPointChartSimple worksheetId numRows col1 col2 title markerSize

Parameters
worksheetId Identifier of the worksheet.
numRows Number of rows beeing used for the chart.
col1 Start column of the chart data.
col2 End column of the chart data.
title(optional, default ) String used as title of the chart.
markerSize(optional, default 5) Size of the point marker.
Description

Add a point chart to a worksheet. Simple case.

Data for the x-axis is taken from column "col1", starting at row 2. Data for the y-axis is taken from column "col2", starting at row 2. Names for the axes are taken from row 1, columns "col1" and "col2".

Return the identifier of the added chart.

See also: CreateChart AddLineChart AddLineChartSimple AddRadarChartSimple

AddRadarChartSimple [::Excel]

Excel, Top

Add a radar chart to a worksheet. Simple case.

AddRadarChartSimple worksheetId numRows numCols title

Parameters
worksheetId Identifier of the worksheet.
numRows Number of rows beeing used for the chart.
numCols Number of columns beeing used for the chart.
title(optional, default ) String used as title of the chart.
Description

Add a radar chart to a worksheet. Simple case.

Data for the x-axis is taken from column 1, starting at row 2. Names for the lines are taken from row 1, starting at column 2. The data range for the "numCols" plots starts at (2, 2) and goes to (numRows+1, numCols+1).

Return the identifier of the added chart.

See also: CreateChart AddLineChart AddLineChartSimple AddPointChartSimple

AddWorkbook [::Excel]

Excel, Top

Add a new workbook with 1 worksheet.

AddWorkbook appId type

Parameters
appId Identifier of the Excel instance.
type(optional, default $::Excel::xlWorksheet) Value of enumeration type XlSheetType (see excelConst.tcl). Possible values: xlChart, xlDialogSheet, xlExcel4IntlMacroSheet, xlExcel4MacroSheet, xlWorksheet
Description

Add a new workbook with 1 worksheet.

Return the identifier of the new workbook.

See also: OpenWorkbook Close SaveAs

AddWorksheet [::Excel]

Excel, Top

Add a new worksheet to the end of a workbook.

AddWorksheet workbookId name visibleType

Parameters
workbookId Identifier of the workbook containing the new worksheet.
name Name of the new worksheet.
visibleType(optional, default $::Excel::xlSheetVisible) Value of enumeration type XlSheetVisibility (see excelConst.tcl). Possible values: xlSheetVisible, xlSheetHidden, xlSheetVeryHidden
Description

Add a new worksheet to the end of a workbook.

Return the identifier of the new worksheet.

See also: GetNumWorksheets DeleteWorksheet

ArrangeWindows [::Excel]

Excel, Top

Arrange the windows of an Excel application.

ArrangeWindows appId arrangeStyle

Parameters
appId Identifier of the Excel instance.
arrangeStyle(optional, default $::Excel::xlArrangeStyleVertical) Value of enumeration type XlArrangeStyle (see excelConst.tcl). Typical values are: xlArrangeStyleHorizontal, xlArrangeStyleTiled, xlArrangeStyleVertical
Description

Arrange the windows of an Excel application.

No return value.

See also: Open Visible SetWindowState

ChartObjToClipboard [::Excel]

Excel, Top

Copy a chart object to the clipboard.

ChartObjToClipboard chartObjId

Parameters
chartObjId Identifier of the chart object.
Description

Copy a chart object to the clipboard.

The chart object is stored in the clipboard as a Windows bitmap file (CF_DIB).

No return value.

See also: SaveChartObjAsImage CreateChart

ChartToClipboard [::Excel]

Excel, Top

Obsolete: Replaced with ChartObjToClipboard in version 1.0.1

ChartToClipboard chartId

Parameters
chartId
Description

Obsolete: Replaced with ChartObjToClipboard in version 1.0.1

ClipboardToMatrix [::Excel]

Excel, Top

Return the matrix values contained in the clipboard.

ClipboardToMatrix sepChar

Parameters
sepChar(optional, default ;) The separation character of the clipboard matrix data.
Description

Return the matrix values contained in the clipboard.

The clipboard data must be in CSV format with sepChar as separation character. See SetMatrixValues for the description of a matrix representation.

See also: ClipboardToWorksheet MatrixToClipboard

ClipboardToWorksheet [::Excel]

Excel, Top

Insert the matrix values contained in the clipboard into a worksheet.

ClipboardToWorksheet worksheetId startRow startCol sepChar

Parameters
worksheetId Identifier of the worksheet.
startRow(optional, default 1) Row number. Row numbering starts with 1.
startCol(optional, default 1) Column number. Column numbering starts with 1.
sepChar(optional, default ;) The separation character of the clipboard matrix data.
Description

Insert the matrix values contained in the clipboard into a worksheet.

The insertion of the matrix data starts at cell "startRow,startCol". The clipboard data must be in CSV format with sepChar as separation character. See SetMatrixValues for the description of a matrix representation.

No return value.

See also: ClipboardToMatrix WorksheetToClipboard

Close [::Excel]

Excel, Top

Close a workbook without saving changes.

Close workbookId

Parameters
workbookId Identifier of the workbook.
Description

Close a workbook without saving changes.

Use the SaveAs method before closing, if you want to save changes.

No return value.

See also: SaveAs OpenWorkbook

ColumnCharToInt [::Excel]

Excel, Top

Return an Excel column string as a column number.

ColumnCharToInt colChar

Parameters
colChar Column string.
Description

Return an Excel column string as a column number.

Example: [ColumnCharToInt A] returns 1.

         [::Excel::ColumnCharToInt Z] returns 26.

See also: ColumnIntToChar

ColumnIntToChar [::Excel]

Excel, Top

Return a column number as an Excel column string.

ColumnIntToChar col

Parameters
col Column number.
Description

Return a column number as an Excel column string.

Example: [ColumnIntToChar 1] returns "A".

         [::Excel::ColumnIntToChar 26] returns "Z".

See also: ColumnCharToInt

CopyWorksheet [::Excel]

Excel, Top

Copy the contents of a worksheet into another worksheet.

CopyWorksheet fromWorksheetId toWorksheetId

Parameters
fromWorksheetId Identifier of the source worksheet.
toWorksheetId Identifier of the destination worksheet.
Description

Copy the contents of a worksheet into another worksheet.

Note, that the contents of worksheet toWorksheetId are overwritten.

No return value.

See also: SelectAll CopyWorksheetBefore CopyWorksheetAfter AddWorksheet

CopyWorksheetAfter [::Excel]

Excel, Top

Copy the contents of a worksheet after another worksheet.

CopyWorksheetAfter fromWorksheetId afterWorksheetId worksheetName

Parameters
fromWorksheetId Identifier of the source worksheet.
afterWorksheetId Identifier of the destination worksheet.
worksheetName(optional, default ) Name of the new worksheet. If no name is specified, or an empty string, the naming is done by Excel.
Description

Copy the contents of a worksheet after another worksheet.

Instead of using the identifier of afterWorksheetId, it is also possible to use the numeric index or the special word "end" for specifying the last worksheet.

Note, that a new worksheet is generated after worksheet afterWorksheetId, while CopyWorksheet overwrites the contents of an existing worksheet. The new worksheet is set as the active sheet.

Return the identifier of the new worksheet.

See also: SelectAll CopyWorksheet CopyWorksheetBefore AddWorksheet

CopyWorksheetBefore [::Excel]

Excel, Top

Copy the contents of a worksheet before another worksheet.

CopyWorksheetBefore fromWorksheetId beforeWorksheetId worksheetName

Parameters
fromWorksheetId Identifier of the source worksheet.
beforeWorksheetId Identifier of the destination worksheet.
worksheetName(optional, default ) Name of the new worksheet. If no name is specified, or an empty string, the naming is done by Excel.
Description

Copy the contents of a worksheet before another worksheet.

Instead of using the identifier of afterWorksheetId, it is also possible to use the numeric index or the special word "end" for specifying the last worksheet.

Note, that a new worksheet is generated before worksheet beforeWorksheetId, while CopyWorksheet overwrites the contents of an existing worksheet. The new worksheet is set as the active sheet.

Return the identifier of the new worksheet.

See also: SelectAll CopyWorksheet CopyWorksheetAfter AddWorksheet

CreateChart [::Excel]

Excel, Top

Create a new empty chart in a worksheet.

CreateChart worksheetId chartType

Parameters
worksheetId Identifier of the worksheet.
chartType Value of enumeration type XlChartType (see excelConst.tcl).
Description

Create a new empty chart in a worksheet.

Return the identifier of the new chart.

See also: PlaceChart AddLineChart AddLineChartSimple AddPointChartSimple AddRadarChartSimple

CsvRowToList [::Excel]

Excel, Top

Return a CSV encoded row as a list of column values.

CsvRowToList rowStr

Parameters
rowStr CSV encoded row as string.
Description

Return a CSV encoded row as a list of column values.

See also: ListToCsvRow

CsvStringToMatrix [::Excel]

Excel, Top

Return a matrix from a CSV encoded table string.

CsvStringToMatrix csvString

Parameters
csvString CSV encoded table as string.
Description

Return a matrix from a CSV encoded table string.

See also: MatrixToCsvString CsvRowToList

DeleteWorksheet [::Excel]

Excel, Top

Delete a worksheet.

DeleteWorksheet workbookId worksheetId

Parameters
workbookId Identifier of the workbook containing the worksheet.
worksheetId Identifier of the worksheet to delete.
Description

Delete a worksheet.

No return value. If the number of worksheets before deletion is 1, an error is thrown.

See also: DeleteWorksheetByIndex GetWorksheetIdByIndex AddWorksheet

DeleteWorksheetByIndex [::Excel]

Excel, Top

Delete a worksheet identified by it's index.

DeleteWorksheetByIndex workbookId index

Parameters
workbookId Identifier of the workbook containing the worksheet.
index Index of the worksheet to delete.
Description

Delete a worksheet identified by it's index.

No return value.

The left-most worksheet has index 1. If the index is out of bounds, or the number of worksheets before deletion is 1, an error is thrown.

See also: GetNumWorksheets GetWorksheetIdByIndex AddWorksheet

DiffExcelFiles [::Excel]

Excel, Top

Compare 2 Excel files visually.

DiffExcelFiles excelBaseFile excelNewFile r g b

Parameters
excelBaseFile Name of the base Excel file.
excelNewFile Name of the new Excel file.
r(optional, default 255) Red component of the mark color.
g(optional, default 0) Green component of the mark color.
b(optional, default 0) Blue component of the mark color.
Description

Compare 2 Excel files visually.

The two Excel files are opened in read-only mode and the cells, which are different in the two Excel files are set to the mark color. As Excel does not allow to load two files with identical names (even from different directories), in that case the excelBaseFile is copied into a temporary directory and renamed.

The algorithm used is identical to the Excel diff script used in Tortoise SVN.

The r, g and b values are specified as integers in the range [0, 255].

Return the identifier of the new Excel application instance.

See also: OpenNew

ExcelFileToMatlabFile [::Excel]

Excel, Top

Convert an Excel file to a Matlab table file.

ExcelFileToMatlabFile excelFileName matFileName worksheetNameOrIndex useHeader quitExcel

Parameters
excelFileName Name of the Excel input file.
matFileName Name of the Matlab output file.
worksheetNameOrIndex(optional, default 0) Worksheet name or index to convert.
useHeader(optional, default true) true: Use the first row of the worksheet as the header of the Matlab file. false: Do not generate a Matlab file header. All worksheet cells are interpreted as data.
quitExcel(optional, default true) true: Quit the Excel instance after generation of output file. false: Leave the Excel instance open after generation of output file.
Description

Convert an Excel file to a Matlab table file.

Note, that the Excel Workbook is opened in read-only mode.

Return the Excel application identifier, if quitExcel is false. Otherwise no return value.

See also: MatlabFileToWorksheet MatlabFileToExcelFile ReadMatlabFile WriteMatlabFile

ExcelFileToMediaWikiFile [::Excel]

Excel, Top

Convert an Excel file to a MediaWiki table file.

ExcelFileToMediaWikiFile excelFileName wikiFileName worksheetNameOrIndex useHeader quitExcel

Parameters
excelFileName Name of the Excel input file.
wikiFileName Name of the MediaWiki output file.
worksheetNameOrIndex(optional, default 0) Worksheet name or index to convert.
useHeader(optional, default true) true: Use the first row of the worksheet as the header of the MediaWiki table. false: Do not generate a MediaWiki table header. All worksheet cells are interpreted as data.
quitExcel(optional, default true) true: Quit the Excel instance after generation of output file. false: Leave the Excel instance open after generation of output file.
Description

Convert an Excel file to a MediaWiki table file.

Note, that the Excel Workbook is opened in read-only mode.

Return the Excel application identifier, if quitExcel is false. Otherwise no return value.

See also: MediaWikiFileToWorksheet MediaWikiFileToExcelFile ReadMediaWikiFile WriteMediaWikiFile WikitFileToExcelFile

ExcelFileToRawImageFile [::Excel]

Excel, Top

Convert an Excel file to a raw photo image file.

ExcelFileToRawImageFile excelFileName rawFileName worksheetNameOrIndex useHeader quitExcel

Parameters
excelFileName Name of the Excel input file.
rawFileName Name of the image output file.
worksheetNameOrIndex(optional, default 0) Worksheet name or index to convert.
useHeader(optional, default true) true: Use the first row of the worksheet as the header of the raw image file. false: Do not generate a raw image file header. All worksheet cells are interpreted as data.
quitExcel(optional, default true) true: Quit the Excel instance after generation of output file. false: Leave the Excel instance open after generation of output file.
Description

Convert an Excel file to a raw photo image file.

Note, that the Excel Workbook is opened in read-only mode.

Return the Excel application identifier, if quitExcel is false. Otherwise no return value.

See also: RawImageFileToWorksheet RawImageFileToExcelFile ReadRawImageFile WriteRawImageFile

ExcelFileToWikitFile [::Excel]

Excel, Top

Convert an Excel file to a Wikit table file.

ExcelFileToWikitFile excelFileName wikiFileName worksheetNameOrIndex useHeader quitExcel

Parameters
excelFileName Name of the Excel input file.
wikiFileName Name of the Wikit output file.
worksheetNameOrIndex(optional, default 0) Worksheet name or index to convert.
useHeader(optional, default true) true: Use the first row of the worksheet as the header of the Wikit table. false: Do not generate a Wikit table header. All worksheet cells are interpreted as data.
quitExcel(optional, default true) true: Quit the Excel instance after generation of output file. false: Leave the Excel instance open after generation of output file.
Description

Convert an Excel file to a Wikit table file.

Note, that the Excel Workbook is opened in read-only mode.

Return the Excel application identifier, if quitExcel is false. Otherwise no return value.

See also: WikitFileToWorksheet WikitFileToExcelFile ReadWikitFile WriteWikitFile MediaWikiFileToExcelFile

FormatHeaderRow [::Excel]

Excel, Top

Format a row as a header row.

FormatHeaderRow worksheetId row startCol endCol

Parameters
worksheetId Identifier of the worksheet.
row Row number. Row numbering starts with 1.
startCol Column number of formatting start. Column numbering starts with 1.
endCol Column number of formatting end. Column numbering starts with 1.
Description

Format a row as a header row.

The cell values of a header are formatted as bold text with both vertical and horizontal centered alignment.

No return value.

See also: SetHeaderRow

FreezePanes [::Excel]

Excel, Top

Freeze a range in a worksheet identified by it's row/column index.

FreezePanes worksheetId row col onOff

Parameters
worksheetId Identifier of the worksheet.
row Row number. Row numbering starts with 1.
col Column number. Column numbering starts with 1.
onOff(optional, default true) true: Freeze the range. false: Unfreeze the range.
Description

Freeze a range in a worksheet identified by it's row/column index.

The rows and columns with indices lower than the specified values are freezed for scrolling. If a row or a column should not be freezed, a value of zero for the corresponding parameter should be given.

See also: SelectCellByIndex

GetActiveWorkbook [::Excel]

Excel, Top

Return the active workbook of an application.

GetActiveWorkbook appId

Parameters
appId Identifier of the Excel instance.
Description

Return the active workbook of an application.

Return the identifier of the active workbook.

See also: OpenWorkbook

GetCellIdByIndex [::Excel]

Excel, Top

Return a cell of a worksheet.

GetCellIdByIndex worksheetId row col

Parameters
worksheetId Identifier of the worksheet.
row Row number. Row numbering starts with 1.
col Column number. Column numbering starts with 1.
Description

Return a cell of a worksheet.

Return the cell identifier of the cell with index (row, col).

See also: SelectCellByIndex AddWorksheet

GetCellRange [::Excel]

Excel, Top

Return a numeric cell range as an Excel range string.

GetCellRange row1 col1 row2 col2

Parameters
row1 Row number of upper-left corner of the cell range.
col1 Column number of upper-left corner of the cell range.
row2 Row number of lower-right corner of the cell range.
col2 Column number of lower-right corner of the cell range.
Description

Return a numeric cell range as an Excel range string.

Example: [GetCellRange 1 2 5 7] returns string "B1:G5".

See also: GetColumnRange

GetCellsId [::Excel]

Excel, Top

Return the cells identifier of a worksheet.

GetCellsId worksheetId

Parameters
worksheetId Identifier of the worksheet.
Description

Return the cells identifier of a worksheet.

Return the range of all cells from a worksheet. This corresponds to the method Cells() of the Worksheet object.

GetCellValue [::Excel]

Excel, Top

Return the value of a cell.

GetCellValue worksheetId row col fmt

Parameters
worksheetId Identifier of the worksheet.
row Row number. Row numbering starts with 1.
col Column number. Column numbering starts with 1.
fmt(optional, default text) Format of the cell. Possible values: "text", "int", "real".
Description

Return the value of a cell.

Depending on the format the value of the cell is returned as a string, integer number or a floating-point number. If the value could not be retrieved, an error is thrown.

See also: SetCellValue ColumnCharToInt

GetColumnRange [::Excel]

Excel, Top

Return a numeric column range as an Excel range string.

GetColumnRange col1 col2

Parameters
col1 Column number of the left-most column.
col2 Column number of the right-most column.
Description

Return a numeric column range as an Excel range string.

Example: [GetColumnRange 2 7] returns string "B:G".

See also: GetCellRange

GetColumnValues [::Excel]

Excel, Top

Return column values as a Tcl list.

GetColumnValues worksheetId col startRow numVals

Parameters
worksheetId Identifier of the worksheet.
col Column number. Column numbering starts with 1.
startRow(optional, default 0) Row number of start. Row numbering starts with 1. Negative or zero: Start at first available row.
numVals(optional, default 0) Negative or zero: All available column values are returned. Positive: Only numVals values of the column are returned.
Description

Return column values as a Tcl list.

Note, that the functionality of this procedure has changed slightly with CAWT versions greater than 1.0.5: If "startRow" is not specified, "startRow" is not set to 1, but it is set to the first available row. Possible incompatibility.

Return the values of the specified column or column range as a Tcl list.

See also: SetColumnValues GetRowValues GetCellValue ColumnCharToInt GetFirstUsedRow

GetCsvSeparatorChar [::Excel]

Excel, Top

Return the column separator character.

GetCsvSeparatorChar

Description

Return the column separator character.

GetExtString [::Excel]

Excel, Top

Return the default extension of an Excel file.

GetExtString appId

Parameters
appId Identifier of the Excel instance.
Description

Return the default extension of an Excel file.

Starting with Excel 12 (2007) this is the string ".xlsx". In previous versions it was ".xls".

GetFirstUsedColumn [::Excel]

Excel, Top

Return the index of the first used column of a worksheet.

GetFirstUsedColumn worksheetId

Parameters
worksheetId Identifier of the worksheet.
Description

Return the index of the first used column of a worksheet.

See also: GetNumColumns GetNumUsedColumns GetLastUsedColumn GetNumUsedRows

GetFirstUsedRow [::Excel]

Excel, Top

Return the index of the first used row of a worksheet.

GetFirstUsedRow worksheetId

Parameters
worksheetId Identifier of the worksheet.
Description

Return the index of the first used row of a worksheet.

See also: GetNumRows GetNumUsedRows GetLastUsedRow GetNumUsedColumns

GetFloatSeparator [::Excel]

Excel, Top

Return the decimal separator used by Excel.

GetFloatSeparator

Description

Return the decimal separator used by Excel.

Only valid, after a call of Open or OpenNew.

See also: GetVersion

GetLangNumberFormat [::Excel]

Excel, Top

Return an Excel number format string.

GetLangNumberFormat pre post

Parameters
pre Number of digits before the decimal point.
post Number of digits after the decimal point.
Description

Return an Excel number format string.

The number of digits is specified as a string containing as many zeros as wanted digits.

Example: [GetLangNumberFormat "0" "0000"] will return the Excel format string to show

         floating point values with 4 digits after the decimal point.

See also: SetRangeFormat

GetLastUsedColumn [::Excel]

Excel, Top

Return the index of the last used column of a worksheet.

GetLastUsedColumn worksheetId

Parameters
worksheetId Identifier of the worksheet.
Description

Return the index of the last used column of a worksheet.

See also: GetNumColumns GetNumUsedColumns GetFirstUsedColumn GetNumUsedRows

GetLastUsedRow [::Excel]

Excel, Top

Return the index of the last used row of a worksheet.

GetLastUsedRow worksheetId

Parameters
worksheetId Identifier of the worksheet.
Description

Return the index of the last used row of a worksheet.

See also: GetNumRows GetNumUsedRows GetFirstUsedRow GetNumUsedColumns

GetMatrixValues [::Excel]

Excel, Top

Return worksheet table values as a matrix.

GetMatrixValues worksheetId row1 col1 row2 col2

Parameters
worksheetId Identifier of the worksheet.
row1 Row number of upper-left corner of the cell range.
col1 Column number of upper-left corner of the cell range.
row2 Row number of lower-right corner of the cell range.
col2 Column number of lower-right corner of the cell range.
Description

Return worksheet table values as a matrix.

See also: SetMatrixValues GetRowValues GetColumnValues

GetMaxColumns [::Excel]

Excel, Top

Return the maximum number of columns of an Excel table.

GetMaxColumns appId

Parameters
appId Identifier of the Excel instance.
Description

Return the maximum number of columns of an Excel table.

See also: GetNumColumns

GetMaxRows [::Excel]

Excel, Top

Return the maximum number of rows of an Excel table.

GetMaxRows appId

Parameters
appId Identifier of the Excel instance.
Description

Return the maximum number of rows of an Excel table.

See also: GetNumRows

GetNumColumns [::Excel]

Excel, Top

Return the number of columns of a cell range.

GetNumColumns rangeId

Parameters
rangeId Identifier of a range, cells collection or a worksheet.
Description

Return the number of columns of a cell range.

If specifying a worksheetId or cellsId, the maximum number of columns of a worksheet will be returned. The maximum number of columns is 256 for Excel versions before 2007. Since 2007 the maximum number of columns is 16.384.

See also: GetMaxColumns GetNumUsedColumns GetFirstUsedColumn GetLastUsedColumn GetNumRows

GetNumRows [::Excel]

Excel, Top

Return the number of rows of a cell range.

GetNumRows rangeId

Parameters
rangeId Identifier of a range, cells collection or a worksheet.
Description

Return the number of rows of a cell range.

If specifying a worksheetId or cellsId, the maximum number of rows of a worksheet will be returned. The maximum number of rows is 65.536 for Excel versions before 2007. Since 2007 the maximum number of rows is 1.048.576.

See also: GetMaxRows GetNumUsedRows GetFirstUsedRow GetLastUsedRow GetNumColumns

GetNumUsedColumns [::Excel]

Excel, Top

Return the number of used columns of a worksheet.

GetNumUsedColumns worksheetId

Parameters
worksheetId Identifier of the worksheet.
Description

Return the number of used columns of a worksheet.

In some cases the number of columns returned may be 1 to high.

See also: GetNumColumns GetFirstUsedColumn GetLastUsedColumn GetNumUsedRows

GetNumUsedRows [::Excel]

Excel, Top

Return the number of used rows of a worksheet.

GetNumUsedRows worksheetId

Parameters
worksheetId Identifier of the worksheet.
Description

Return the number of used rows of a worksheet.

See also: GetNumRows GetFirstUsedRow GetLastUsedRow GetNumUsedColumns

GetNumWorksheets [::Excel]

Excel, Top

Return the number of worksheets in a workbook.

GetNumWorksheets workbookId

Parameters
workbookId Identifier of the workbook.
Description

Return the number of worksheets in a workbook.

See also: AddWorksheet OpenWorkbook

GetRangeCharacters [::Excel]

Excel, Top

Return characters of a cell range.

GetRangeCharacters rangeId start length

Parameters
rangeId Identifier of the cell range.
start(optional, default 1) Start of the character range.
length(optional, default -1) The number of characters after start.
Description

Return characters of a cell range.

Return all or a range of characters of a cell range. If no optional parameters are specified, all characters of the cell range are returned.

See also: SelectRangeByIndex SelectRangeByString

GetRangeFillColor [::Excel]

Excel, Top

Get the fill color of a cell range.

GetRangeFillColor rangeId

Parameters
rangeId Identifier of the cell range.
Description

Get the fill color of a cell range.

The r, g and b values are returned as integers in the range [0, 255].

Return the fill color as a list of r, b and b values.

See also: SetRangeFillColor ::Cawt::ColorToRgb SelectRangeByIndex SelectRangeByString

GetRowValues [::Excel]

Excel, Top

Return row values as a Tcl list.

GetRowValues worksheetId row startCol numVals

Parameters
worksheetId Identifier of the worksheet.
row Row number. Row numbering starts with 1.
startCol(optional, default 0) Column number of start. Column numbering starts with 1. Negative or zero: Start at first available column.
numVals(optional, default 0) Negative or zero: All available row values are returned. Positive: Only numVals values of the row are returned.
Description

Return row values as a Tcl list.

Note, that the functionality of this procedure has changed slightly with CAWT versions greater than 1.0.5: If "startCol" is not specified, "startCol" is not set to 1, but it is set to the first available row. Possible incompatibility.

Return the values of the specified row or row range as a Tcl list.

See also: SetRowValues GetColumnValues GetCellValue ColumnCharToInt GetFirstUsedColumn

GetTablelistHeader [::Excel]

Excel, Top

Return the header line of a tablelist as a list.

GetTablelistHeader tableId

Parameters
tableId Identifier of the tablelist.
Description

Return the header line of a tablelist as a list.

See also: TablelistToWorksheet WorksheetToTablelist SetTablelistHeader GetTablelistValues

GetTablelistValues [::Excel]

Excel, Top

Return the values of a tablelist as a matrix.

GetTablelistValues tableId

Parameters
tableId Identifier of the tablelist.
Description

Return the values of a tablelist as a matrix.

See also: TablelistToWorksheet WorksheetToTablelist SetTablelistValues GetTablelistHeader

GetVersion [::Excel]

Excel, Top

Return the version of an Excel application.

GetVersion appId useString

Parameters
appId Identifier of the Excel instance.
useString(optional, default false) true: Return the version name (ex. "Excel 2000"). false: Return the version number (ex. "9.0").
Description

Return the version of an Excel application.

Both version name and version number are returned as strings. Version number is in a format, so that it can be evaluated as a floating point number.

See also: GetFloatSeparator

GetWorkbookName [::Excel]

Excel, Top

Return the name of a workbook.

GetWorkbookName workbookId

Parameters
workbookId Identifier of the workbook.
Description

Return the name of a workbook.

See also: AddWorkbook

GetWorksheetAsMatrix [::Excel]

Excel, Top

Return worksheet table as a matrix.

GetWorksheetAsMatrix worksheetId

Parameters
worksheetId Identifier of the worksheet.
Description

Return worksheet table as a matrix.

Return the range of the worksheet with valid data as a matrix.

See also: SetMatrixValues GetMatrixValues GetFirstUsedRow GetLastUsedRow

GetWorksheetIdByIndex [::Excel]

Excel, Top

Find a worksheet by it's index.

GetWorksheetIdByIndex workbookId index activate

Parameters
workbookId Identifier of the workbook containing the worksheet.
index Index of the worksheet to find.
activate(optional, default true) true: Activate the found worksheet. false: Just return the identifier.
Description

Find a worksheet by it's index.

Return the identifier of the found worksheet. The left-most worksheet has index 1. Instead of using the numeric index the special word "end" may be used to specify the last worksheet. If the index is out of bounds an error is thrown.

See also: GetNumWorksheets GetWorksheetIdByName AddWorksheet

GetWorksheetIdByName [::Excel]

Excel, Top

Find a worksheet by it's name.

GetWorksheetIdByName workbookId worksheetName activate

Parameters
workbookId Identifier of the workbook containing the worksheet.
worksheetName Name of the worksheet to find.
activate(optional, default true) true: Activate the found worksheet. false: Just return the identifier.
Description

Find a worksheet by it's name.

Return the identifier of the found worksheet. If a worksheet with given name does not exist an error is thrown.

See also: GetNumWorksheets GetWorksheetIndexByName GetWorksheetIdByIndex AddWorksheet

GetWorksheetIndexByName [::Excel]

Excel, Top

Find a worksheet index by it's name.

GetWorksheetIndexByName workbookId worksheetName activate

Parameters
workbookId Identifier of the workbook containing the worksheet.
worksheetName Name of the worksheet to find.
activate(optional, default true) true: Activate the found worksheet. false: Just return the index.
Description

Find a worksheet index by it's name.

Return the index of the found worksheet. The left-most worksheet has index 1. If a worksheet with given name does not exist an error is thrown.

See also: GetNumWorksheets GetWorksheetIdByIndex GetWorksheetIdByName AddWorksheet

GetWorksheetName [::Excel]

Excel, Top

Return the name of a worksheet.

GetWorksheetName worksheetId

Parameters
worksheetId Identifier of the worksheet.
Description

Return the name of a worksheet.

See also: SetWorksheetName AddWorksheet

ImgToWorksheet [::Excel]

Excel, Top

Put a photo image into a worksheet.

ImgToWorksheet phImg worksheetId row col rowHeight colWidth

Parameters
phImg The photo image identifier.
worksheetId Identifier of the worksheet.
row(optional, default 1) Row number of the top-left corner of the image. Row numbering starts with 1.
col(optional, default 1) Column number of the top-left corner of the image. Column numbering starts with 1.
rowHeight(optional, default 9) Row height in points.
colWidth(optional, default 1) Column width in average-size characters of the widget's font.
Description

Put a photo image into a worksheet.

Note: Use only with small images.

No return value.

See also: WorksheetToImg ImgToClipboard RawImageFileToWorksheet SetRowHeight SetColumnWidth

InsertImage [::Excel]

Excel, Top

Insert an image into a worksheet.

InsertImage worksheetId imgFileName row col

Parameters
worksheetId Identifier of the worksheet where the image is inserted.
imgFileName File name of the image (as absolute path).
row(optional, default 1) Row number. Row numbering starts with 1.
col(optional, default 1) Column number. Column numbering starts with 1.
Description

Insert an image into a worksheet.

The file name of the image must be an absolute pathname. Use a construct like [file join [pwd] "myImage.gif"] to insert images from the current directory.

Return the identifier of the inserted image.

See also: ScaleImage

IsWorkbookProtected [::Excel]

Excel, Top

Check, if a workbook is protected.

IsWorkbookProtected workbookId

Parameters
workbookId Identifier of the workbook to be checked.
Description

Check, if a workbook is protected.

Return true, if the workbook is protected, otherwise false.

See also: OpenWorkbook

IsWorksheetProtected [::Excel]

Excel, Top

Check, if a worksheet is content protected.

IsWorksheetProtected worksheetId

Parameters
worksheetId Identifier of the worksheet to be checked.
Description

Check, if a worksheet is content protected.

Return true, if the worksheet is protected, otherwise false.

See also: AddWorksheet

IsWorksheetVisible [::Excel]

Excel, Top

Check, if a worksheet is visible.

IsWorksheetVisible worksheetId

Parameters
worksheetId Identifier of the worksheet to be checked.
Description

Check, if a worksheet is visible.

Return true, if the worksheet is visible, otherwise false.

See also: AddWorksheet

ListToCsvRow [::Excel]

Excel, Top

Return a list of column values as a CSV encoded row string.

ListToCsvRow rowList

Parameters
rowList List of column values.
Description

Return a list of column values as a CSV encoded row string.

See also: CsvRowToList

MatlabFileToExcelFile [::Excel]

Excel, Top

Convert a Matlab table file to an Excel file.

MatlabFileToExcelFile matFileName excelFileName useHeader quitExcel

Parameters
matFileName Name of the Matlab input file.
excelFileName Name of the Excel output file.
useHeader(optional, default true) true: Insert the header of the Matlab file as first row. false: Only transfer the data values as floating point values.
quitExcel(optional, default true) true: Quit the Excel instance after generation of output file. false: Leave the Excel instance open after generation of output file.
Description

Convert a Matlab table file to an Excel file.

The table data from the Matlab file will be inserted into a worksheet name "Matlab".

Return the Excel application identifier, if quitExcel is false. Otherwise no return value.

See also: MatlabFileToWorksheet ExcelFileToMatlabFile ReadMatlabFile

MatlabFileToWorksheet [::Excel]

Excel, Top

Insert the data values of a Matlab file into a worksheet.

MatlabFileToWorksheet matFileName worksheetId useHeader

Parameters
matFileName Name of the Matlab file.
worksheetId Identifier of the worksheet.
useHeader(optional, default true) true: Insert the header of the Matlab file as first row. false: Only transfer the data values as floating point values.
Description

Insert the data values of a Matlab file into a worksheet.

The header information are as follows: MatlabVersion Width Height

Note: Only Matlab Level 4 files are currently supported.

No return value.

See also: WorksheetToMatrixValues SetMatrixValues WikitFileToWorksheet MediaWikiFileToWorksheet RawImageFileToWorksheet TablelistToWorksheet WordTableToWorksheet

MatrixToClipboard [::Excel]

Excel, Top

Copy a matrix into the clipboard.

MatrixToClipboard matrixList sepChar

Parameters
matrixList Matrix with table data.
sepChar(optional, default ;) The separation character of the clipboard matrix data.
Description

Copy a matrix into the clipboard.

The clipboard data will be in CSV format with sepChar as separation character. See SetMatrixValues for the description of a matrix representation.

No return value.

See also: WorksheetToClipboard ClipboardToMatrix

MatrixToCsvString [::Excel]

Excel, Top

Return a CSV encoded table string from a matrix list.

MatrixToCsvString matrixList

Parameters
matrixList Matrix with table data.
Description

Return a CSV encoded table string from a matrix list.

See also: CsvStringToMatrix ListToCsvRow

MediaWikiFileToExcelFile [::Excel]

Excel, Top

Convert a MediaWiki table file to an Excel file.

MediaWikiFileToExcelFile wikiFileName excelFileName useHeader quitExcel

Parameters
wikiFileName Name of the MediaWiki input file.
excelFileName Name of the Excel output file.
useHeader(optional, default true) true: Use header information from the MediaWiki file to generate an Excel header (see SetHeaderRow). false: Only transfer the table data.
quitExcel(optional, default true) true: Quit the Excel instance after generation of output file. false: Leave the Excel instance open after generation of output file.
Description

Convert a MediaWiki table file to an Excel file.

The table data from the MediaWiki file will be inserted into a worksheet named "MediaWiki".

Return the Excel application identifier, if quitExcel is false. Otherwise no return value.

See also: MediaWikiFileToWorksheet ExcelFileToMediaWikiFile ReadMediaWikiFile WriteMediaWikiFile WikitFileToExcelFile

MediaWikiFileToWorksheet [::Excel]

Excel, Top

Insert the values of a MediaWiki table file into a worksheet.

MediaWikiFileToWorksheet wikiFileName worksheetId useHeader

Parameters
wikiFileName Name of the MediaWiki file.
worksheetId Identifier of the worksheet.
useHeader(optional, default true) true: Insert the header of the MediaWiki table as first row. false: Only transfer the table data.
Description

Insert the values of a MediaWiki table file into a worksheet.

The insertion starts at row and column 1. Values contained in the worksheet cells are overwritten.

No return value.

See also: WorksheetToMediaWikiFile SetMatrixValues WikitFileToWorksheet WordTableToWorksheet MatlabFileToWorksheet RawImageFileToWorksheet TablelistToWorksheet

Open [::Excel]

Excel, Top

Open an Excel instance. Use an already running Excel, if available.

Open visible width height

Parameters
visible(optional, default true) true: Show the application window. false: Hide the application window.
width(optional, default -1) Width of the application window. If negative, open with last used width.
height(optional, default -1) Height of the application window. If negative, open with last used height.
Description

Open an Excel instance. Use an already running Excel, if available.

Return the identifier of the Excel application instance.

See also: OpenNew Quit Visible

OpenNew [::Excel]

Excel, Top

Open a new Excel instance.

OpenNew visible width height

Parameters
visible(optional, default true) true: Show the application window. false: Hide the application window.
width(optional, default -1) Width of the application window. If negative, open with last used width.
height(optional, default -1) Height of the application window. If negative, open with last used height.
Description

Open a new Excel instance.

Return the identifier of the new Excel application instance.

See also: Open Quit Visible

OpenWorkbook [::Excel]

Excel, Top

Open a workbook, i.e load an Excel file.

OpenWorkbook appId fileName readOnly

Parameters
appId Identifier of the Excel instance.
fileName Name of the Excel file (as absolute path).
readOnly(optional, default false) true: Open the workbook in read-only mode. false: Open the workbook in read-write mode.
Description

Open a workbook, i.e load an Excel file.

Return the identifier of the opened workbook. If the workbook was already open, activate that workbook and return the identifier to that workbook.

See also: AddWorkbook Close SaveAs

PlaceChart [::Excel]

Excel, Top

Place an existing chart into a worksheet.

PlaceChart chartId worksheetId

Parameters
chartId Identifier of the chart.
worksheetId Identifier of the worksheet.
Description

Place an existing chart into a worksheet.

Return the ChartObject identifier of the placed chart.

See also: CreateChart SetChartObjSize SetChartObjPosition

Quit [::Excel]

Excel, Top

Quit an Excel application instance.

Quit appId showAlert

Parameters
appId Identifier of the Excel instance.
showAlert(optional, default true) true: Show an alert window, if there are unsaved changes. false: Quit without asking and saving any changes.
Description

Quit an Excel application instance.

No return value.

See also: Open OpenNew

RawImageFileToExcelFile [::Excel]

Excel, Top

Convert a raw photo image file to an Excel file.

RawImageFileToExcelFile rawFileName excelFileName useHeader quitExcel

Parameters
rawFileName Name of the raw photo image input file.
excelFileName Name of the Excel output file.
useHeader(optional, default true) true: Use header information from the image file to generate an Excel header (see SetHeaderRow). false: Only transfer the image data.
quitExcel(optional, default true) true: Quit the Excel instance after generation of output file. false: Leave the Excel instance open after generation of output file.
Description

Convert a raw photo image file to an Excel file.

The table data from the image file will be inserted into a worksheet name "RawImage".

Return the Excel application identifier, if quitExcel is false. Otherwise no return value.

See also: RawImageFileToWorksheet ExcelFileToRawImageFile ReadRawImageFile WriteRawImageFile

RawImageFileToWorksheet [::Excel]

Excel, Top

Insert the pixel values of a raw photo image into a worksheet.

RawImageFileToWorksheet rawFileName worksheetId useHeader

Parameters
rawFileName File name of the image.
worksheetId Identifier of the worksheet.
useHeader(optional, default true) true: Insert the header of the raw image as first row. false: Only transfer the pixel values as floating point values.
Description

Insert the pixel values of a raw photo image into a worksheet.

The header information are as follows: Magic Width Height NumChan ByteOrder ScanOrder PixelType

Note: Only 1-channel floating-point raw images are currently supported.

No return value.

See also: WorksheetToRawImageFile SetMatrixValues WikitFileToWorksheet MediaWikiFileToWorksheet MatlabFileToWorksheet TablelistToWorksheet WordTableToWorksheet

ReadCsvFile [::Excel]

Excel, Top

Read a CSV table file into a matrix.

ReadCsvFile csvFileName useHeader numHeaderRows

Parameters
csvFileName Name of the MediaWiki file.
useHeader(optional, default true) true: Insert the header rows of the CSV file into the matrix. false: Only transfer the table data.
numHeaderRows(optional, default 0) Number of rows interpreted as header rows.
Description

Read a CSV table file into a matrix.

Return the CSV table data as a matrix. See SetMatrixValues for the description of a matrix representation.

See also: WriteCsvFile

ReadMatlabFile [::Excel]

Excel, Top

Read a Matlab file into a matrix.

ReadMatlabFile matFileName

Parameters
matFileName Name of the Matlab file.
Description

Read a Matlab file into a matrix.

Note: Only Matlab Level 4 files are currently supported.

Return the Matlab file data as a matrix. See SetMatrixValues for the description of a matrix representation.

See also: ReadMatlabHeader WriteMatlabFile MatlabFileToWorksheet

ReadMatlabHeader [::Excel]

Excel, Top

Read the header of a Matlab file.

ReadMatlabHeader matFileName

Parameters
matFileName Name of the Matlab file.
Description

Read the header of a Matlab file.

Return the header information as a list of integers containing the following values: MatlabVersion Width Height

See also: ReadMatlabFile

ReadMediaWikiFile [::Excel]

Excel, Top

Read a MediaWiki table file into a matrix.

ReadMediaWikiFile wikiFileName useHeader

Parameters
wikiFileName Name of the MediaWiki file.
useHeader(optional, default true) true: Insert the header of the MediaWiki table as first row. false: Only transfer the table data.
Description

Read a MediaWiki table file into a matrix.

Return the MediaWiki table data as a matrix. See SetMatrixValues for the description of a matrix representation.

See also: WriteMediaWikiFile MediaWikiFileToWorksheet

ReadRawImageFile [::Excel]

Excel, Top

Read a raw photo image into a matrix.

ReadRawImageFile rawImgFile

Parameters
rawImgFile File name of the image.
Description

Read a raw photo image into a matrix.

Note: Only 1-channel floating-point raw images are currently supported.

Return the image data as a matrix. See SetMatrixValues for the description of a matrix representation.

See also: ReadRawImageHeader WriteRawImageFile RawImageFileToWorksheet

ReadRawImageHeader [::Excel]

Excel, Top

Read the header of a raw photo image.

ReadRawImageHeader rawImgFile

Parameters
rawImgFile File name of the image.
Description

Read the header of a raw photo image.

Return the header information as a list containing the following values: Magic Width Height NumChan ByteOrder ScanOrder PixelType

See also: ReadRawImageFile

ReadWikitFile [::Excel]

Excel, Top

Read a Wikit table file into a matrix.

ReadWikitFile wikiFileName useHeader

Parameters
wikiFileName Name of the Wikit file.
useHeader(optional, default true) true: Insert the header of the Wikit table as first row. false: Only transfer the table data.
Description

Read a Wikit table file into a matrix.

Return the Wikit table data as a matrix. See SetMatrixValues for the description of a matrix representation.

See also: WriteWikitFile WikitFileToWorksheet

ResizeChartObj [::Excel]

Excel, Top

Set the position and size of a chart object.

ResizeChartObj chartObjId rangeId

Parameters
chartObjId Identifier of the chart object.
rangeId Identifier of the cell range.
Description

Set the position and size of a chart object.

Resize the chart object so that it fits into the specified cell range.

No return value.

See also: PlaceChart SetChartObjSize SetChartObjPosition SelectRangeByString

SaveAs [::Excel]

Excel, Top

Save a workbook to an Excel file.

SaveAs workbookId fileName fmt backup

Parameters
workbookId Identifier of the workbook to save.
fileName Name of the Excel file.
fmt(optional, default ) Value of enumeration type XlSheetType (see excelConst.tcl). If not given or the empty string, the file is stored in the native format corresponding to the used Excel version.
backup(optional, default false) true: Create a backup file before saving. false: Do not create a backup file.
Description

Save a workbook to an Excel file.

No return value.

See also: SaveAsCsv Close OpenWorkbook

SaveAsCsv [::Excel]

Excel, Top

Save a worksheet to file in CSV format.

SaveAsCsv workbookId worksheetId fileName

Parameters
workbookId Identifier of the workbook containing the worksheet.
worksheetId Identifier of the worksheet to save.
fileName Name of the CSV file.
Description

Save a worksheet to file in CSV format.

No return value.

See also: SaveAs Close OpenWorkbook

SaveChartAsImage [::Excel]

Excel, Top

Obsolete: Replaced with SaveChartObjAsImage in version 1.0.1

SaveChartAsImage chartId fileName filterType

Parameters
chartId
fileName
filterType(optional, default GIF)
Description

Obsolete: Replaced with SaveChartObjAsImage in version 1.0.1

SaveChartObjAsImage [::Excel]

Excel, Top

Save a chart as an image in a file.

SaveChartObjAsImage chartObjId fileName filterType

Parameters
chartObjId Identifier of the chart object.
fileName Image file name.
filterType(optional, default GIF) Name of graphic filter. Possible values: GIF, JPEG, PNG.
Description

Save a chart as an image in a file.

No return value.

See also: ChartObjToClipboard CreateChart

ScaleImage [::Excel]

Excel, Top

Scale an image.

ScaleImage picId scaleWidth scaleHeight

Parameters
picId Identifier of the image.
scaleWidth Horizontal scale factor.
scaleHeight Vertical scale factor.
Description

Scale an image.

The scale factors are floating point values. 1.0 means no scaling.

No return value.

See also: InsertImage

ScreenUpdate [::Excel]

Excel, Top

Toggle the screen updating of an Excel application window.

ScreenUpdate appId onOff

Parameters
appId Identifier of the Excel instance.
onOff true: Update the application window. false: Do not update the application window.
Description

Toggle the screen updating of an Excel application window.

No return value.

See also: Visible SetWindowState ArrangeWindows

Search [::Excel]

Excel, Top

Find a string in a worksheet cell range.

Search worksheetId str row1 col1 row2 col2

Parameters
worksheetId Identifier of the worksheet.
str Search string.
row1(optional, default 1) Row number of upper-left corner of the cell range.
col1(optional, default 1) Column number of upper-left corner of the cell range.
row2(optional, default -1) Row number of lower-right corner of the cell range.
col2(optional, default -1) Column number of lower-right corner of the cell range.
Description

Find a string in a worksheet cell range.

If row2 or col2 is negative, all used rows and columns are searched.

Return the first matching cell as a 2-element list {row, col} of indices. If no cell matches the search criteria, an empty list is returned.

SelectAll [::Excel]

Excel, Top

Select all cells of a worksheet.

SelectAll worksheetId

Parameters
worksheetId Identifier of the worksheet.
Description

Select all cells of a worksheet.

Return the cells collection of the selected cells.

See also: CopyWorksheet

SelectCellByIndex [::Excel]

Excel, Top

Select a cell by it's row/column index.

SelectCellByIndex worksheetId row col visSel

Parameters
worksheetId Identifier of the worksheet.
row Row number. Row numbering starts with 1.
col Column number. Column numbering starts with 1.
visSel(optional, default false) true: See the selection in the user interface. false: The selection is not visible.
Description

Select a cell by it's row/column index.

Return the identifier of the cell as a range identifier.

See also: SelectRangeByIndex AddWorksheet

SelectRangeByIndex [::Excel]

Excel, Top

Select a range by specifying a numeric cell range.

SelectRangeByIndex worksheetId row1 col1 row2 col2 visSel

Parameters
worksheetId Identifier of the worksheet.
row1 Row number of upper-left corner of the cell range.
col1 Column number of upper-left corner of the cell range.
row2 Row number of lower-right corner of the cell range.
col2 Column number of lower-right corner of the cell range.
visSel(optional, default false) true: See the selection in the user interface. false: The selection is not visible.
Description

Select a range by specifying a numeric cell range.

Return the range identifier of the cell range.

See also: SelectCellByIndex GetCellRange

SelectRangeByString [::Excel]

Excel, Top

Select a range by specifying an Excel range string.

SelectRangeByString worksheetId rangeStr visSel

Parameters
worksheetId Identifier of the worksheet.
rangeStr String specifying a cell range.
visSel(optional, default false) true: See the selection in the user interface. false: The selection is not visible.
Description

Select a range by specifying an Excel range string.

Return the range identifier of the cell range.

See also: SelectRangeByIndex GetCellRange

SetCellValue [::Excel]

Excel, Top

Set the value of a cell.

SetCellValue worksheetId row col val fmt subFmt

Parameters
worksheetId Identifier of the worksheet.
row Row number. Row numbering starts with 1.
col Column number. Column numbering starts with 1.
val String value of the cell.
fmt(optional, default text) Format of the cell. Possible values: "text", "int", "real".
subFmt(optional, default ) Formatting option of the floating-point value (see SetRangeFormat).
Description

Set the value of a cell.

The value to be inserted is interpreted either as string, integer or floating-point number according to the formats specified in "fmt" and "subFmt".

See also: GetCellValue SetRowValues SetMatrixValues

SetChartMaxScale [::Excel]

Excel, Top

Set the maximum scale of an axis of a chart.

SetChartMaxScale chartId axisName value

Parameters
chartId Identifier of the chart.
axisName Name of axis. Possible values: "x" or "y".
value Scale value.
Description

Set the maximum scale of an axis of a chart.

No return value.

See also: SetChartMinScale SetChartScale SetChartObjSize

SetChartMinScale [::Excel]

Excel, Top

Set the minimum scale of an axis of a chart.

SetChartMinScale chartId axisName value

Parameters
chartId Identifier of the chart.
axisName Name of axis. Possible values: "x" or "y".
value Scale value.
Description

Set the minimum scale of an axis of a chart.

No return value.

See also: SetChartMaxScale SetChartScale SetChartObjSize

SetChartObjPosition [::Excel]

Excel, Top

Set the position of a chart object.

SetChartObjPosition chartObjId left top

Parameters
chartObjId Identifier of the chart object.
left Left border of the chart object in pixel.
top Top border of the chart object in pixel.
Description

Set the position of a chart object.

No return value.

See also: PlaceChart SetChartObjSize SetChartScale

SetChartObjSize [::Excel]

Excel, Top

Set the size of a chart object.

SetChartObjSize chartObjId width height

Parameters
chartObjId Identifier of the chart object.
width Width of the chart object in pixel.
height Height of the chart object in pixel.
Description

Set the size of a chart object.

No return value.

See also: PlaceChart SetChartObjPosition SetChartScale

SetChartScale [::Excel]

Excel, Top

Set the minimum and maximum scale of both axes of a chart.

SetChartScale chartId xmin xmax ymin ymax

Parameters
chartId Identifier of the chart.
xmin Minimum scale value of x axis.
xmax Maximum scale value of x axis.
ymin Minimum scale value of y axis.
ymax Maximum scale value of y axis.
Description

Set the minimum and maximum scale of both axes of a chart.

No return value.

See also: SetChartMinScale SetChartMaxScale SetChartObjSize

SetChartSize [::Excel]

Excel, Top

Obsolete: Replaced with SetChartObjSize in version 1.0.1

SetChartSize worksheetId chartId width height

Parameters
worksheetId
chartId
width
height
Description

Obsolete: Replaced with SetChartObjSize in version 1.0.1

SetColumnsWidth [::Excel]

Excel, Top

Set the width of a range of columns.

SetColumnsWidth worksheetId startCol endCol width

Parameters
worksheetId Identifier of the worksheet.
startCol Range start column number. Column numbering starts with 1.
endCol Range end column number. Column numbering starts with 1.
width(optional, default 0) A positive value specifies the column's width in average-size characters of the widget's font. A value of zero specifies that the column's width fits automatically the width of all elements in the column.
Description

Set the width of a range of columns.

No return value.

See also: SetColumnWidth ColumnCharToInt

SetColumnValues [::Excel]

Excel, Top

Insert column values from a Tcl list.

SetColumnValues worksheetId col valList startRow numVals

Parameters
worksheetId Identifier of the worksheet.
col Column number. Column numbering starts with 1.
valList List of values to be inserted.
startRow(optional, default 1) Row number of insertion start. Row numbering starts with 1.
numVals(optional, default 0) Negative or zero: All list values are inserted. Positive: numVals rows are filled with the list values (starting at list index 0).
Description

Insert column values from a Tcl list.

No return value.

See also: GetColumnValues SetRowValues SetCellValue ColumnCharToInt

SetColumnWidth [::Excel]

Excel, Top

Set the width of a column.

SetColumnWidth worksheetId col width

Parameters
worksheetId Identifier of the worksheet.
col Column number. Column numbering starts with 1.
width(optional, default 0) A positive value specifies the column's width in average-size characters of the widget's font. A value of zero specifies that the column's width fits automatically the width of all elements in the column.
Description

Set the width of a column.

No return value.

See also: SetColumnsWidth ColumnCharToInt

SetCommentDisplayMode [::Excel]

Excel, Top

Set the global display mode of comments.

SetCommentDisplayMode appId showComment showIndicator

Parameters
appId Identifier of the Excel instance.
showComment(optional, default false) true: Show the comments. false: Do not show the comments.
showIndicator(optional, default true) true: Show an indicator for the comments. false: Do not show an indicator.
Description

Set the global display mode of comments.

No return value.

See also: SetRangeComment

SetCommentSize [::Excel]

Excel, Top

Set the shape size of a comment.

SetCommentSize commentId width height

Parameters
commentId Identifier of the comment.
width Width of the comment.
height Height of the comment.
Description

Set the shape size of a comment.

The size values must be specified in points. Use ::Cawt::CentiMetersToPoints or ::Cawt::InchesToPoints for conversion.

No return value.

See also: SetRangeComment ::Cawt::CentiMetersToPoints ::Cawt::InchesToPoints

SetCsvSeparatorChar [::Excel]

Excel, Top

Set the column separator character.

SetCsvSeparatorChar separatorChar

Parameters
separatorChar(optional, default ;) The character used as the column separator.
Description

Set the column separator character.

SetHeaderRow [::Excel]

Excel, Top

Insert row values from a Tcl list and format as a header row.

SetHeaderRow worksheetId headerList row startCol

Parameters
worksheetId Identifier of the worksheet.
headerList List of values to be inserted as header.
row(optional, default 1) Row number. Row numbering starts with 1.
startCol(optional, default 1) Column number of insertion start. Column numbering starts with 1.
Description

Insert row values from a Tcl list and format as a header row.

No return value. If headerList is an empty list, an error is thrown.

See also: SetRowValues FormatHeaderRow

SetHyperlink [::Excel]

Excel, Top

Insert a hyperlink into a cell.

SetHyperlink worksheetId row col link textDisplay

Parameters
worksheetId Identifier of the worksheet the hyperlink is inserted to.
row Row number. Row numbering starts with 1.
col Column number. Column numbering starts with 1.
link URL of the hyperlink.
textDisplay(optional, default ) Text to be displayed instead of the URL.
Description

Insert a hyperlink into a cell.

URL's are specified as strings: "file://myLinkedFile"; specifies a link to a local file. "http://myLinkedWebpage"; specifies a link to a web address.

No return value.

See also: AddWorksheet SetHyperlinkToFile SetHyperlinkToCell SetLinkToCell

SetHyperlinkToCell [::Excel]

Excel, Top

Insert a hyperlink to a cell into another cell.

SetHyperlinkToCell srcWorksheetId srcRow srcCol destWorksheetId destRow destCol textDisplay

Parameters
srcWorksheetId Identifier of the worksheet the link points to.
srcRow Source row number. Row numbering starts with 1.
srcCol Source column number. Column numbering starts with 1.
destWorksheetId Identifier of the worksheet the link is inserted into.
destRow Destination row number. Row numbering starts with 1.
destCol Destination column number. Column numbering starts with 1.
textDisplay(optional, default ) Text to be displayed instead of the hyperlink.
Description

Insert a hyperlink to a cell into another cell.

No return value.

See also: AddWorksheet SetHyperlinkToFile SetHyperlink SetLinkToCell

SetHyperlinkToFile [::Excel]

Excel, Top

Insert a hyperlink to a file into a cell.

SetHyperlinkToFile worksheetId row col fileName textDisplay

Parameters
worksheetId Identifier of the worksheet the hyperlink is inserted to.
row Row number. Row numbering starts with 1.
col Column number. Column numbering starts with 1.
fileName Absolute path name of the linked file.
textDisplay(optional, default ) Text to be displayed instead of the file name.
Description

Insert a hyperlink to a file into a cell.

No return value.

See also: AddWorksheet SetHyperlinkToCell SetHyperlink SetLinkToCell

SetLinkToCell [::Excel]

Excel, Top

Insert an internal link to a cell into another cell.

SetLinkToCell srcWorksheetId srcRow srcCol destWorksheetId destRow destCol

Parameters
srcWorksheetId Identifier of the worksheet the link points to.
srcRow Source row number. Row numbering starts with 1.
srcCol Source column number. Column numbering starts with 1.
destWorksheetId Identifier of the worksheet the link is inserted to.
destRow Destination row number. Row numbering starts with 1.
destCol Destination column number. Column numbering starts with 1.
Description

Insert an internal link to a cell into another cell.

No return value.

See also: SetHyperlinkToCell SetHyperlinkToFile SetHyperlink

SetMatrixValues [::Excel]

Excel, Top

Insert matrix values into a worksheet.

SetMatrixValues worksheetId matrixList startRow startCol

Parameters
worksheetId Identifier of the worksheet.
matrixList Matrix with table data.
startRow(optional, default 1) Row number of insertion start. Row numbering starts with 1.
startCol(optional, default 1) Column number of insertion start. Column numbering starts with 1.
Description

Insert matrix values into a worksheet.

The matrix data must be stored as a list of lists. Each sub-list contains the values for the row values. The main (outer) list contains the rows of the matrix. Example: { { R1_C1 R1_C2 R1_C3 } { R2_C1 R2_C2 R2_C3 } }

No return value.

See also: GetMatrixValues SetRowValues SetColumnValues

SetRangeBorder [::Excel]

Excel, Top

Set the attributes of one border of a cell range.

SetRangeBorder rangeId side weight lineStyle r g b

Parameters
rangeId Identifier of the cell range.
side Value of enumeration type XlBordersIndex (see excelConst.tcl). Typical values: xlEdgeLeft, xlEdgeTop, xlEdgeBottom, xlEdgeRight.
weight(optional, default $::Excel::xlThin) Value of enumeration type XlBorderWeight (see excelConst.tcl). Typical values: xlThin, xlMedium, xlThick.
lineStyle(optional, default $::Excel::xlContinuous) Value of enumeration type XlLineStyle (see excelConst.tcl). Typical values: xlContinuous, xlDash, xlDot.
r(optional, default 0) Red component of the border color.
g(optional, default 0) Green component of the border color.
b(optional, default 0) Blue component of the border color.
Description

Set the attributes of one border of a cell range.

The r, g and b values are specified as integers in the range [0, 255].

No return value.

See also: SetRangeBorders SelectRangeByIndex SelectRangeByString

SetRangeBorders [::Excel]

Excel, Top

Set the attributes of all borders of a cell range.

SetRangeBorders rangeId weight lineStyle r g b

Parameters
rangeId Identifier of the cell range.
weight(optional, default $::Excel::xlThin) Value of enumeration type XlBorderWeight (see excelConst.tcl). Typical values: xlThin, xlMedium, xlThick.
lineStyle(optional, default $::Excel::xlContinuous) Value of enumeration type XlLineStyle (see excelConst.tcl). Typical values: xlContinuous, xlDash, xlDot.
r(optional, default 0) Red component of the border color.
g(optional, default 0) Green component of the border color.
b(optional, default 0) Blue component of the border color.
Description

Set the attributes of all borders of a cell range.

The r, g and b values are specified as integers in the range [0, 255].

No return value.

See also: SetRangeBorder SelectRangeByIndex SelectRangeByString

SetRangeComment [::Excel]

Excel, Top

Set the comment text of a cell range.

SetRangeComment rangeId comment imgFileName addUserName visible

Parameters
rangeId Identifier of the cell range.
comment Comment text.
imgFileName(optional, default ) File name of an image used as comment background (as absolute path).
addUserName(optional, default true) Automatically add user name before comment text.
visible(optional, default false) true: Show the comment window. false: Hide the comment window.
Description

Set the comment text of a cell range.

Note, that an already existing comment is overwritten.

A comment may be used as a mouse-over tooltip, if parameter showComments of SetCommentDisplayMode is set to false. For a selection tooltip, use SetRangeTooltip.

Return the comment identifier.

See also: SelectRangeByIndex SelectRangeByString SetCommentDisplayMode SetRangeTooltip ::Cawt::GetUserName

SetRangeFillColor [::Excel]

Excel, Top

Set the fill color of a cell range.

SetRangeFillColor rangeId r g b

Parameters
rangeId Identifier of the cell range.
r Red component of the background fill color.
g Green component of the background fill color.
b Blue component of the background fill color.
Description

Set the fill color of a cell range.

The r, g and b values are specified as integers in the range [0, 255].

No return value.

See also: SetRangeTextColor ::Cawt::RgbToColor SelectRangeByIndex SelectRangeByString

SetRangeFontBold [::Excel]

Excel, Top

Set the bold font style of a cell range.

SetRangeFontBold rangeId onOff

Parameters
rangeId Identifier of the cell range.
onOff(optional, default true) true: Set bold style on. false: Set bold style off.
Description

Set the bold font style of a cell range.

No return value.

See also: SetRangeFontItalic SelectRangeByIndex SelectRangeByString

SetRangeFontItalic [::Excel]

Excel, Top

Set the italic font style of a cell range.

SetRangeFontItalic rangeId onOff

Parameters
rangeId Identifier of the cell range.
onOff(optional, default true) true: Set italic style on. false: Set italic style off.
Description

Set the italic font style of a cell range.

No return value.

See also: SetRangeFontBold SelectRangeByIndex SelectRangeByString

SetRangeFontSubscript [::Excel]

Excel, Top

Set the subscript font style of a cell or character range.

SetRangeFontSubscript rangeId onOff

Parameters
rangeId Identifier of the cell range.
onOff(optional, default true) true: Set subscript style on. false: Set subscript style off.
Description

Set the subscript font style of a cell or character range.

No return value.

See also: SetRangeFontSuperscript SelectRangeByIndex GetRangeCharacters

SetRangeFontSuperscript [::Excel]

Excel, Top

Set the superscript font style of a cell or character range.

SetRangeFontSuperscript rangeId onOff

Parameters
rangeId Identifier of the cell range.
onOff(optional, default true) true: Set superscript style on. false: Set superscript style off.
Description

Set the superscript font style of a cell or character range.

No return value.

See also: SetRangeFontSubscript SelectRangeByIndex GetRangeCharacters

SetRangeFormat [::Excel]

Excel, Top

Set the format of a cell range.

SetRangeFormat rangeId fmt subFmt

Parameters
rangeId Identifier of the cell range.
fmt Format of the cell range. Possible values: "text", "int", "real".
subFmt(optional, default ) Sub-format of the cell range. Only valid, if fmt is "real". Then it specifies the number of digits before and after the decimal point. Use the GetLangNumberFormat procedure for specifying the sub-format. If subFmt is the empty string 2 digits after the decimal point are used.
Description

Set the format of a cell range.

No return value.

See also: SelectRangeByIndex SelectRangeByString

SetRangeHorizontalAlignment [::Excel]

Excel, Top

Set the horizontal alignment of a cell range.

SetRangeHorizontalAlignment rangeId align

Parameters
rangeId Identifier of the cell range.
align Value of enumeration type XlHAlign (see excelConst.tcl).
Description

Set the horizontal alignment of a cell range.

No return value.

See also: SetRangeVerticalAlignment SelectRangeByIndex SelectRangeByString

SetRangeMergeCells [::Excel]

Excel, Top

Merge/Unmerge a range of cells.

SetRangeMergeCells rangeId onOff

Parameters
rangeId Identifier of the cell range.
onOff(optional, default true) true: Set cell merge on. false: Set cell merge off.
Description

Merge/Unmerge a range of cells.

No return value.

See also: SetRangeVerticalAlignment SelectRangeByIndex SelectRangeByString

SetRangeTextColor [::Excel]

Excel, Top

Set the text color of a cell range.

SetRangeTextColor rangeId r g b

Parameters
rangeId Identifier of the cell range.
r Red component of the text color.
g Green component of the text color.
b Blue component of the text color.
Description

Set the text color of a cell range.

The r, g and b values are specified as integers in the range [0, 255].

No return value.

See also: SetRangeFillColor ::Cawt::RgbToColor SelectRangeByIndex SelectRangeByString

SetRangeTooltip [::Excel]

Excel, Top

Set a selection based tooltip for a cell range.

SetRangeTooltip rangeId tooltipMessage tooltipTitle

Parameters
rangeId Identifier of the cell range.
tooltipMessage The tooltip message string.
tooltipTitle(optional, default ) The optional tooltip title string.
Description

Set a selection based tooltip for a cell range.

The tooltip will be shown, if the cell is selected by the user. It is implemented by using the data validation functionality of Excel. If a mouse-over tooltip is needed, use SetRangeComment.

Return the validation identifier.

See also: SelectRangeByIndex SelectRangeByString SetRangeComment

SetRangeVerticalAlignment [::Excel]

Excel, Top

Set the vertical alignment of a cell range.

SetRangeVerticalAlignment rangeId align

Parameters
rangeId Identifier of the cell range.
align Value of enumeration type XlVAlign (see excelConst.tcl).
Description

Set the vertical alignment of a cell range.

No return value.

See also: SetRangeHorizontalAlignment SelectRangeByIndex SelectRangeByString

SetRowHeight [::Excel]

Excel, Top

Set the height of a row.

SetRowHeight worksheetId row height

Parameters
worksheetId Identifier of the worksheet.
row Row number. Row numbering starts with 1.
height(optional, default 0) A positive value specifies the row's height in points. A value of zero specifies that the rows's height fits automatically the height of all elements in the row.
Description

Set the height of a row.

No return value.

See also: SetRowsHeight SetColumnWidth ColumnCharToInt

SetRowsHeight [::Excel]

Excel, Top

Set the height of a range of rows.

SetRowsHeight worksheetId startRow endRow height

Parameters
worksheetId Identifier of the worksheet.
startRow Range start row number. Row numbering starts with 1.
endRow Range end row number. Row numbering starts with 1.
height(optional, default 0) A positive value specifies the row's height in points. A value of zero specifies that the rows's height fits automatically the height of all elements in the row.
Description

Set the height of a range of rows.

No return value.

See also: SetRowHeight SetColumnsWidth ColumnCharToInt

SetRowValues [::Excel]

Excel, Top

Insert row values from a Tcl list.

SetRowValues worksheetId row valList startCol numVals

Parameters
worksheetId Identifier of the worksheet.
row Row number. Row numbering starts with 1.
valList List of values to be inserted.
startCol(optional, default 1) Column number of insertion start. Column numbering starts with 1.
numVals(optional, default 0) Negative or zero: All list values are inserted. Positive: numVals columns are filled with the list values (starting at list index 0).
Description

Insert row values from a Tcl list.

No return value. If valList is an empty list, an error is thrown.

See also: GetRowValues SetColumnValues SetCellValue ColumnCharToInt

SetTablelistHeader [::Excel]

Excel, Top

Insert header values into a tablelist.

SetTablelistHeader tableId headerList

Parameters
tableId
headerList
Description

Insert header values into a tablelist.

No return value.

tableId Identifier of the tablelist.
headerList List with table header data.

See also: TablelistToWorksheet WorksheetToTablelist SetTablelistValues GetTablelistHeader

SetTablelistValues [::Excel]

Excel, Top

Insert matrix values into a tablelist.

SetTablelistValues tableId matrixList

Parameters
tableId
matrixList
Description

Insert matrix values into a tablelist.

No return value.

tableId Identifier of the tablelist.
matrixList Matrix with table data.

See also: TablelistToWorksheet WorksheetToTablelist SetTablelistHeader GetTablelistValues

SetWindowState [::Excel]

Excel, Top

Set the window state of an Excel application.

SetWindowState appId windowState

Parameters
appId Identifier of the Excel instance.
windowState(optional, default $::Excel::xlNormal) Value of enumeration type XlWindowState (see excelConst.tcl). Typical values are: xlMaximized, xlMinimized, xlNormal.
Description

Set the window state of an Excel application.

No return value.

See also: Open Visible ArrangeWindows

SetWorksheetFitToPages [::Excel]

Excel, Top

Adjust a worksheet to fit onto given number of pages.

SetWorksheetFitToPages worksheetId wide tall

Parameters
worksheetId Identifier of the worksheet.
wide(optional, default 1) The number of pages in horizontal direction.
tall(optional, default 1) The number of pages in vertical direction.
Description

Adjust a worksheet to fit onto given number of pages.

When using the default values for wide and tall, the worksheet is adjusted to fit onto exactly one piece of paper.

No return value.

See also: AddWorksheet

SetWorksheetName [::Excel]

Excel, Top

Set the name of a worksheet.

SetWorksheetName worksheetId name

Parameters
worksheetId Identifier of the worksheet.
name Name of the worksheet.
Description

Set the name of a worksheet.

No return value.

See also: GetWorksheetName AddWorksheet

SetWorksheetOrientation [::Excel]

Excel, Top

Set the orientation of a worksheet.

SetWorksheetOrientation worksheetId orientation

Parameters
worksheetId Identifier of the worksheet.
orientation Value of enumeration type XlPageOrientation (see excelConst.tcl). Possible values: xlLandscape or xlPortrait.
Description

Set the orientation of a worksheet.

No return value.

See also: AddWorksheet

SetWorksheetTabColor [::Excel]

Excel, Top

Set the color of the tab of a worksheet.

SetWorksheetTabColor worksheetId r g b

Parameters
worksheetId Identifier of the worksheet.
r Red component of the tab color.
g Green component of the tab color.
b Blue component of the tab color.
Description

Set the color of the tab of a worksheet.

The r, g and b values are specified as integers in the range [0, 255].

No return value.

See also: SetRangeTextColor ::Cawt::RgbToColor GetWorksheetIdByIndex

SetWorksheetZoom [::Excel]

Excel, Top

Set the zoom factor for printing of a worksheet.

SetWorksheetZoom worksheetId zoom

Parameters
worksheetId Identifier of the worksheet.
zoom(optional, default 100) The zoom factor in percent as an integer value.
Description

Set the zoom factor for printing of a worksheet.

Valid zoom values are in the range [10, 400].

No return value.

See also: AddWorksheet

ShowCellByIndex [::Excel]

Excel, Top

Show a cell identified by it's row/column index.

ShowCellByIndex worksheetId row col

Parameters
worksheetId Identifier of the worksheet.
row Row number. Row numbering starts with 1.
col Column number. Column numbering starts with 1.
Description

Show a cell identified by it's row/column index.

Set the scrolling, so that the cell is show at the upper left corner.

See also: SelectCellByIndex

TablelistToWorksheet [::Excel]

Excel, Top

Insert the values of a tablelist into a worksheet.

TablelistToWorksheet tableId worksheetId useHeader startRow

Parameters
tableId Identifier of the tablelist.
worksheetId Identifier of the worksheet.
useHeader(optional, default true) true: Insert the header of the tablelist as first row. false: Only transfer the tablelist data.
startRow(optional, default 1) Row number of insertion start. Row numbering starts with 1.
Description

Insert the values of a tablelist into a worksheet.

No return value.

See also: WorksheetToTablelist SetMatrixValues WikitFileToWorksheet MediaWikiFileToWorksheet MatlabFileToWorksheet RawImageFileToWorksheet WordTableToWorksheet

ToggleAutoFilter [::Excel]

Excel, Top

Toggle the AutoFilter switch of a cell range.

ToggleAutoFilter rangeId

Parameters
rangeId Identifier of the cell range.
Description

Toggle the AutoFilter switch of a cell range.

No return value.

See also: SelectRangeByIndex SelectRangeByString

UnhideWorksheet [::Excel]

Excel, Top

Unhide a worksheet, if it is hidden.

UnhideWorksheet worksheetId r g b

Parameters
worksheetId Identifier of the worksheet.
r(optional, default 0) Red component of the tab color.
g(optional, default 128) Green component of the tab color.
b(optional, default 0) Blue component of the tab color.
Description

Unhide a worksheet, if it is hidden.

If the worksheet is hidden, it is made visible and the tab color is set to the specified color.

The r, g and b values are specified as integers in the range [0, 255].

No return value.

See also: SetWorksheetTabColor IsWorksheetVisible ::Cawt::RgbToColor

UseImgTransparency [::Excel]

Excel, Top

UseImgTransparency onOff

Parameters
onOff

Visible [::Excel]

Excel, Top

Toggle the visibilty of an Excel application window.

Visible appId visible

Parameters
appId Identifier of the Excel instance.
visible true: Show the application window. false: Hide the application window.
Description

Toggle the visibilty of an Excel application window.

No return value.

See also: Open OpenNew SetWindowState ArrangeWindows

WikitFileToExcelFile [::Excel]

Excel, Top

Convert a Wikit table file to an Excel file.

WikitFileToExcelFile wikiFileName excelFileName useHeader quitExcel

Parameters
wikiFileName Name of the Wikit input file.
excelFileName Name of the Excel output file.
useHeader(optional, default true) true: Use header information from the Wikit file to generate an Excel header (see SetHeaderRow). false: Only transfer the table data.
quitExcel(optional, default true) true: Quit the Excel instance after generation of output file. false: Leave the Excel instance open after generation of output file.
Description

Convert a Wikit table file to an Excel file.

The table data from the Wikit file will be inserted into a worksheet named "Wikit".

Return the Excel application identifier, if quitExcel is false. Otherwise no return value.

See also: WikitFileToWorksheet ExcelFileToWikitFile ReadWikitFile MediaWikiFileToExcelFile

WikitFileToWorksheet [::Excel]

Excel, Top

Insert the values of a Wikit table file into a worksheet.

WikitFileToWorksheet wikiFileName worksheetId useHeader

Parameters
wikiFileName Name of the Wikit file.
worksheetId Identifier of the worksheet.
useHeader(optional, default true) true: Insert the header of the Wikit table as first row. false: Only transfer the table data.
Description

Insert the values of a Wikit table file into a worksheet.

The insertion starts at row and column 1. Values contained in the worksheet cells are overwritten.

No return value.

See also: WorksheetToWikitFile SetMatrixValues MediaWikiFileToWorksheet WordTableToWorksheet MatlabFileToWorksheet RawImageFileToWorksheet TablelistToWorksheet

WordTableToWorksheet [::Excel]

Excel, Top

Insert the values of a Word table into a worksheet.

WordTableToWorksheet tableId worksheetId useHeader

Parameters
tableId Identifier of the Word table.
worksheetId Identifier of the worksheet.
useHeader(optional, default true) true: Insert the header of the Word table as first row. false: Only transfer the table data.
Description

Insert the values of a Word table into a worksheet.

No return value.

See also: WorksheetToWordTable SetMatrixValues WikitFileToWorksheet MediaWikiFileToWorksheet MatlabFileToWorksheet RawImageFileToWorksheet TablelistToWorksheet

WorksheetToClipboard [::Excel]

Excel, Top

Copy worksheet data into the clipboard.

WorksheetToClipboard worksheetId row1 col1 row2 col2 sepChar

Parameters
worksheetId Identifier of the worksheet.
row1 Row number of upper-left corner of the copy range.
col1 Column number of upper-left corner of the copy range.
row2 Row number of lower-right corner of the copy range.
col2 Column number of lower-right corner of the copy range.
sepChar(optional, default ;) The separation character of the clipboard matrix data.
Description

Copy worksheet data into the clipboard.

The clipboard data will be in CSV format with sepChar as separation character.

No return value.

See also: ClipboardToWorksheet MatrixToClipboard

WorksheetToImg [::Excel]

Excel, Top

Put worksheet background colors into a photo image.

WorksheetToImg worksheetId startRow startCol endRow endCol

Parameters
worksheetId Identifier of the worksheet.
startRow(optional, default 1) Row number of the top-left corner of the image.
startCol(optional, default 1) Column number of the top-left corner of the image.
endRow(optional, default end) Row number of the bottom-right corner of the image.
endCol(optional, default end) Column number of the bottom-right corner of the image.
Description

Put worksheet background colors into a photo image.

Note: Row and column numbering starts with 1.

      Instead of using the number for endRow or endCol, it is possible to use
      the special word "end" to use the last used row or column.

Return the photo image identifier.

See also: ImgToWorksheet ImgToClipboard RawImageFileToWorksheet

          GetLastUsedRow GetLastUsedColumn

WorksheetToMatlabFile [::Excel]

Excel, Top

Insert the values of a worksheet into a Matlab file.

WorksheetToMatlabFile worksheetId matFileName useHeader

Parameters
worksheetId Identifier of the worksheet.
matFileName Name of the Matlab file.
useHeader(optional, default true) true: Interpret the first row of the worksheet as header and thus do not transfer this row into the Matlab file. false: All worksheet cells are interpreted as data.
Description

Insert the values of a worksheet into a Matlab file.

Note: Only Matlab Level 4 files are currently supported.

No return value.

See also: MatlabFileToWorksheet GetMatrixValues WorksheetToWikitFile WorksheetToMediaWikiFile WorksheetToRawImageFile WorksheetToTablelist WorksheetToWordTable

WorksheetToMediaWikiFile [::Excel]

Excel, Top

Insert the values of a worksheet into a MediaWiki table file.

WorksheetToMediaWikiFile worksheetId wikiFileName useHeader

Parameters
worksheetId Identifier of the worksheet.
wikiFileName Name of the MediaWiki file.
useHeader(optional, default true) true: Use the first row of the worksheet as the header of the MediaWiki table. false: Do not generate a MediaWiki table header. All worksheet cells are interpreted as data.
Description

Insert the values of a worksheet into a MediaWiki table file.

No return value.

See also: MediaWikiFileToWorksheet GetMatrixValues WorksheetToWikitFile WorksheetToWordTable WorksheetToMatlabFile WorksheetToRawImageFile WorksheetToTablelist

WorksheetToRawImageFile [::Excel]

Excel, Top

Insert the values of a worksheet into a raw photo image file.

WorksheetToRawImageFile worksheetId rawFileName useHeader

Parameters
worksheetId Identifier of the worksheet.
rawFileName File name of the image.
useHeader(optional, default true) true: Interpret the first row of the worksheet as header and thus do not transfer this row into the image. false: All worksheet cells are interpreted as data.
Description

Insert the values of a worksheet into a raw photo image file.

The image generated is a 1-channel floating point photo image. It can be read and manipulated with the Img extension. It is not a "raw" image as used with digital cameras, but just "raw" image data.

No return value.

See also: RawImageFileToWorksheet GetMatrixValues WorksheetToWikitFile WorksheetToMediaWikiFile WorksheetToMatlabFile WorksheetToTablelist WorksheetToWordTable

WorksheetToTablelist [::Excel]

Excel, Top

Insert the values of a worksheet into a tablelist.

WorksheetToTablelist worksheetId tableId useHeader

Parameters
worksheetId Identifier of the worksheet.
tableId Identifier of the tablelist.
useHeader(optional, default true) true: Use the first row of the worksheet as the header of the tablelist. false: Do not generate a tablelist header. All worksheet cells are interpreted as data.
Description

Insert the values of a worksheet into a tablelist.

No return value.

See also: TablelistToWorksheet GetMatrixValues WorksheetToWikitFile WorksheetToMediaWikiFile WorksheetToMatlabFile WorksheetToRawImageFile WorksheetToWordTable

WorksheetToWikitFile [::Excel]

Excel, Top

Insert the values of a worksheet into a Wikit table file.

WorksheetToWikitFile worksheetId wikiFileName useHeader

Parameters
worksheetId Identifier of the worksheet.
wikiFileName Name of the Wikit file.
useHeader(optional, default true) true: Use the first row of the worksheet as the header of the Wikit table. false: Do not generate a Wikit table header. All worksheet cells are interpreted as data.
Description

Insert the values of a worksheet into a Wikit table file.

No return value.

See also: WikitFileToWorksheet GetMatrixValues WorksheetToMediaWikiFile WorksheetToWordTable WorksheetToMatlabFile WorksheetToRawImageFile WorksheetToTablelist

WorksheetToWordTable [::Excel]

Excel, Top

Insert the values of a worksheet into a Word table.

WorksheetToWordTable worksheetId tableId useHeader

Parameters
worksheetId Identifier of the worksheet.
tableId Identifier of the Word table.
useHeader(optional, default true) true: Use the first row of the worksheet as the header of the Word table. false: Do not generate a Word table header. All worksheet cells are interpreted as data.
Description

Insert the values of a worksheet into a Word table.

No return value.

See also: WordTableToWorksheet GetMatrixValues WorksheetToWikitFile WorksheetToMediaWikiFile WorksheetToMatlabFile WorksheetToRawImageFile WorksheetToTablelist

WriteCsvFile [::Excel]

Excel, Top

Write the values of a matrix into a CSV file.

WriteCsvFile matrixList csvFileName

Parameters
matrixList Matrix with table data.
csvFileName Name of the CSV file.
Description

Write the values of a matrix into a CSV file.

See SetMatrixValues for the description of a matrix representation.

No return value.

See also: ReadCsvFile

WriteMatlabFile [::Excel]

Excel, Top

Write the values of a matrix into a Matlab file.

WriteMatlabFile matrixList matFileName

Parameters
matrixList Floating point matrix.
matFileName Name of the Matlab file.
Description

Write the values of a matrix into a Matlab file.

Note: Only Matlab Level 4 files are currently supported. See SetMatrixValues for the description of a matrix representation.

No return value.

See also: ReadMatlabFile WorksheetToMatlabFile

WriteMediaWikiFile [::Excel]

Excel, Top

Write the values of a matrix into a MediaWiki table file.

WriteMediaWikiFile matrixList wikiFileName useHeader tableName

Parameters
matrixList Matrix with table data.
wikiFileName Name of the MediaWiki file.
useHeader(optional, default true) true: Use first row of the matrix as header of the MediaWiki table. false: Only transfer the table data.
tableName(optional, default ) Table name (caption) of the generated MediaWiki table.
Description

Write the values of a matrix into a MediaWiki table file.

See SetMatrixValues for the description of a matrix representation.

No return value.

See also: ReadMediaWikiFile WorksheetToMediaWikiFile

WriteRawImageFile [::Excel]

Excel, Top

Write the values of a matrix into a raw photo image file.

WriteRawImageFile matrixList rawImgFile

Parameters
matrixList Floating point matrix.
rawImgFile File name of the image.
Description

Write the values of a matrix into a raw photo image file.

Note: The matrix values are written as a 1-channel floating-point image.

See SetMatrixValues for the description of a matrix representation.

No return value.

See also: ReadRawImageFile WorksheetToRawImageFile

WriteWikitFile [::Excel]

Excel, Top

Write the values of a matrix into a Wikit table file.

WriteWikitFile matrixList wikiFileName useHeader

Parameters
matrixList Matrix with table data.
wikiFileName Name of the Wikit file.
useHeader(optional, default true) true: Use first row of the matrix as header of the Wikit table.
Description

Write the values of a matrix into a Wikit table file.

See SetMatrixValues for the description of a matrix representation.

No return value.

See also: ReadWikitFile WorksheetToWikitFile

::Explorer

Introduction

The Explorer namespace provides commands to control the Internet Explorer browser.

Note: If running on Windows Vista or 7, you have to lower the security settings like follows:

Internet Options -> Security -> Trusted Sites : Low

Internet Options -> Security -> Internet : Medium + unchecked Enable Protected Mode

Internet Options -> Security -> Restricted Sites : unchecked Enable Protected Mode

Commands

FullScreen [::Explorer]

Explorer, Top

Toggle the fullscreen mode of an Internet Explorer application window.

FullScreen appId onOff

Parameters
appId Identifier of the Internet Explorer instance.
onOff true: Use fullscreen mode. false: Use windowed mode.
Description

Toggle the fullscreen mode of an Internet Explorer application window.

No return value.

See also: Open Visible

Go [::Explorer]

Explorer, Top

Go to a specific page.

Go appId target

Parameters
appId Identifier of the Internet Explorer instance.
target String identifying the target page.
Description

Go to a specific page.

Possible values for target are: "Back", "Forward", "Home", "Search"

No return value.

IsBusy [::Explorer]

Explorer, Top

Check, if an Internet Explorer instance is busy.

IsBusy appId

Parameters
appId Identifier of the Internet Explorer instance.
Description

Check, if an Internet Explorer instance is busy.

Return true or false dependent on the busy status.

Navigate [::Explorer]

Explorer, Top

Navigate to a URL or local file.

Navigate appId urlOrFile wait targetFrame

Parameters
appId Identifier of the Internet Explorer instance.
urlOrFile URL or local file name (as an absolute pathname).
wait(optional, default true) Wait until page has been loaded completely.
targetFrame(optional, default _self) Name of the frame in which to display the resource.
Description

Navigate to a URL or local file.

The following predefined names for targetFrame are possible: "_blank": Load the link into a new unnamed window. "_parent": Load the link into the immediate parent of the document the link is in. "_self": Load the link into the same window the link was clicked in. "_top": Load the link into the full body of the current window.

If given any other string, it is interpreted as a named HTML frame. If no frame or window exists that matches the specified target name, a new window is opened for the specified link.

No return value.

See also: Open OpenNew

Open [::Explorer]

Explorer, Top

Open an Internet Explorer instance. Use an already running Internet Explorer, if available.

Open visible width height

Parameters
visible(optional, default true) true: Show the application window. false: Hide the application window.
width(optional, default -1) Width of the application window. If negative, open with last used width.
height(optional, default -1) Height of the application window. If negative, open with last used height.
Description

Open an Internet Explorer instance. Use an already running Internet Explorer, if available.

Return the identifier of the Internet Explorer application instance.

See also: OpenNew Quit Visible

OpenNew [::Explorer]

Explorer, Top

Open a new Internet Explorer instance.

OpenNew visible width height

Parameters
visible(optional, default true) true: Show the application window. false: Hide the application window.
width(optional, default -1) Width of the application window. If negative, open with last used width.
height(optional, default -1) Height of the application window. If negative, open with last used height.
Description

Open a new Internet Explorer instance.

Return the identifier of the new Internet Explorer application instance.

See also: Open Quit Visible

Quit [::Explorer]

Explorer, Top

Quit a Internet Explorer application instance.

Quit appId

Parameters
appId Identifier of the Internet Explorer instance.
Description

Quit a Internet Explorer application instance.

No return value.

See also: Open

Visible [::Explorer]

Explorer, Top

Toggle the visibilty of an Internet Explorer application window.

Visible appId visible

Parameters
appId Identifier of the Internet Explorer instance.
visible true: Show the application window. false: Hide the application window.
Description

Toggle the visibilty of an Internet Explorer application window.

No return value.

See also: Open OpenNew

::Matlab

Introduction

The Matlab namespace provides commands to control MathWorks Matlab.

Commands

ExecCmd [::Matlab]

Matlab, Top

Execute a Matlab command.

ExecCmd appId cmd

Parameters
appId Identifier of the Matlab instance.
cmd String containg the Matlab command being executed.
Description

Execute a Matlab command.

Return the Matlab answer as a string.

Open [::Matlab]

Matlab, Top

Open a Matlab instance. Use an already running Matlab, if available.

Open visible

Parameters
visible(optional, default true) true: Show the application window. false: Hide the application window.
Description

Open a Matlab instance. Use an already running Matlab, if available.

Return the identifier of the Matlab application instance.

See also: OpenNew Visible Quit

OpenNew [::Matlab]

Matlab, Top

Open a new Matlab instance.

OpenNew visible

Parameters
visible(optional, default true) true: Show the application window. false: Hide the application window.
Description

Open a new Matlab instance.

Return the identifier of the new Matlab application instance.

See also: Open Visible Quit

Quit [::Matlab]

Matlab, Top

Quit a Matlab application instance.

Quit appId

Parameters
appId Identifier of the Matlab instance.
Description

Quit a Matlab application instance.

No return value.

See also: Open

Visible [::Matlab]

Matlab, Top

Toggle the visibilty of a Matlab application window.

Visible appId visible

Parameters
appId Identifier of the Matlab instance.
visible true: Show the application window. false: Hide the application window.
Description

Toggle the visibilty of a Matlab application window.

No return value.

See also: Open OpenNew

::Ocr

Introduction

The Ocr namespace provides commands to control Microsoft Document Imaging.

Commands

Close [::Ocr]

Ocr, Top

Close an OCR document instance.

Close docId

Parameters
docId Identifier of the OCR document.
Description

Close an OCR document instance.

No return value.

See also: Open

GetFullText [::Ocr]

Ocr, Top

Return the recognized text of a OCR layout.

GetFullText layoutId

Parameters
layoutId Identifier of the OCR layout.
Description

Return the recognized text of a OCR layout.

See also: Scan

GetNumImages [::Ocr]

Ocr, Top

Return the number of images of an OCR document.

GetNumImages docId

Parameters
docId Identifier of the OCR document.
Description

Return the number of images of an OCR document.

See also: OpenDocument Scan

GetNumWords [::Ocr]

Ocr, Top

Return the number of words identified in an OCR document.

GetNumWords layoutId

Parameters
layoutId Identifier of the OCR layout.
Description

Return the number of words identified in an OCR document.

See also: GetFullText GetNumImages Scan

GetWord [::Ocr]

Ocr, Top

Return the text of a recognized word.

GetWord layoutId wordNum

Parameters
layoutId Identifier of the OCR layout.
wordNum Index number of the word (starting at zero).
Description

Return the text of a recognized word.

See also: GetFullText GetNumWords Scan

GetWordStats [::Ocr]

Ocr, Top

Return statistics of a recognized word.

GetWordStats layoutId wordNum

Parameters
layoutId Identifier of the OCR layout.
wordNum Index number of the word (starting at zero).
Description

Return statistics of a recognized word.

The statistics is returned as a dictionary containing the following keys: Id, LineId, RegionId, FontId, Confidence.

See also: GetFullText GetWord Scan

Open [::Ocr]

Ocr, Top

Open an OCR document instance.

Open

Description

Open an OCR document instance.

Return the OCR document identifier.

See also: OpenDocument Close

OpenDocument [::Ocr]

Ocr, Top

Open an image file for OCR scanning.

OpenDocument docId fileName

Parameters
docId OCR document identifier.
fileName Image to be scanned. Must be in TIFF or BMP format.
Description

Open an image file for OCR scanning.

No return value.

See also: Open Close

Scan [::Ocr]

Ocr, Top

Scan an image.

Scan docId imgNum

Parameters
docId Identifier of the OCR document.
imgNum(optional, default 0) Image number to be scanned.
Description

Scan an image.

Return the layout identifier of the scanned image.

See also: OpenDocument GetNumImages

::Outlook

Introduction

The Outlook namespace provides commands to control Microsoft Outlook.

Commands

CreateMail [::Outlook]

Outlook, Top

Create a new Outlook mail.

CreateMail appId recipientList subject body attachmentList

Parameters
appId Identifier of the Outlook instance.
recipientList List of mail addresses.
subject(optional, default ) Subject text.
body(optional, default ) Mail body text.
attachmentList(optional, default ) List of files used as attachment.
Description

Create a new Outlook mail.

Return the identifier of the new mail object.

See also: SendMail

GetVersion [::Outlook]

Outlook, Top

Return the version of a Outlook application.

GetVersion appId useString

Parameters
appId Identifier of the Outlook instance.
useString(optional, default false) true: Return the version name (ex. "Outlook 2000"). false: Return the version number (ex. "9.0").
Description

Return the version of a Outlook application.

Both version name and version number are returned as strings. Version number is in a format, so that it can be evaluated as a floating point number.

See also: GetCompatibilityMode GetExtString

Open [::Outlook]

Outlook, Top

Open a Outlook instance. Use an already running Outlook, if available.

Open width height

Parameters
width(optional, default -1) Width of the application window. If negative, open with last used width.
height(optional, default -1) Height of the application window. If negative, open with last used height.
Description

Open a Outlook instance. Use an already running Outlook, if available.

Return the identifier of the Outlook application instance.

See also: OpenNew Quit

OpenNew [::Outlook]

Outlook, Top

Open a new Outlook instance.

OpenNew width height

Parameters
width(optional, default -1) Width of the application window. If negative, open with last used width.
height(optional, default -1) Height of the application window. If negative, open with last used height.
Description

Open a new Outlook instance.

Return the identifier of the new Outlook application instance.

See also: Open Quit

Quit [::Outlook]

Outlook, Top

Quit a Outlook application instance.

Quit appId showAlert

Parameters
appId Identifier of the Outlook instance.
showAlert(optional, default true) true: Show an alert window, if there are unsaved changes. false: Quit without saving any changes.
Description

Quit a Outlook application instance.

No return value.

See also: Open OpenNew

SendMail [::Outlook]

Outlook, Top

Send an Outlook mail.

SendMail mailId

Parameters
mailId Identifier of the Outlook mail object.
Description

Send an Outlook mail.

No return value.

See also: CreateMail

::Ppt

Introduction

The Ppt namespace provides commands to control Microsoft PowerPoint.

Commands

AddPres [::Ppt]

Ppt, Top

Add a new empty presentation.

AddPres appId templateFile

Parameters
appId Identifier of the PowerPoint instance.
templateFile(optional, default ) Name of an optional template file (as absolute path).
Description

Add a new empty presentation.

Return the identifier of the new presentation.

See also: OpenPres GetActivePres

AddSlide [::Ppt]

Ppt, Top

Add a new slide to a presentation.

AddSlide presId type slideIndex

Parameters
presId Identifier of the presentation.
type(optional, default $::Ppt::ppLayoutBlank) Value of enumeration type PpSlideLayout (see pptConst.tcl) or CustomLayout object.
slideIndex(optional, default -1) Insertion index of new slide. Slide indices start at 1. If negative or "end", add slide at the end.
Description

Add a new slide to a presentation.

Note, that CustomLayouts are not supported with PowerPoint versions before 2007.

TODO: Add to SeeAlso about CustomLayouts

Return the identifier of the new slide.

See also: CopySlide

Close [::Ppt]

Ppt, Top

Close a presentation without saving changes.

Close presId

Parameters
presId Identifier of the presentation to close.
Description

Close a presentation without saving changes.

Use the SaveAs method before closing, if you want to save changes.

No return value.

See also: SaveAs CloseAll

CloseAll [::Ppt]

Ppt, Top

Close all presentations of a PowerPoint instance.

CloseAll appId

Parameters
appId Identifier of the PowerPoint instance.
Description

Close all presentations of a PowerPoint instance.

Use the SaveAs method before closing, if you want to save changes.

No return value.

See also: SaveAs Close

CopySlide [::Ppt]

Ppt, Top

Copy the contents of a slide into another slide.

CopySlide presId fromSlideIndex toSlideIndex toPresId

Parameters
presId Identifier of the presentation.
fromSlideIndex Index of source slide. Slide indices start at 1. If negative or "end", use last slide as source.
toSlideIndex(optional, default -1) Insertion index of copied slide. Slide indices start at 1. If negative or "end", insert slide at the end.
toPresId(optional, default ) Identifier of the presentation the slide is copied to. If not specified or the empty string, the slide is copied into presentation presId.
Description

Copy the contents of a slide into another slide.

A new empty slide is created at the insertion index and the contents of the source slide are copied into the new slide.

Return the identifier of the new slide.

See also: AddSlide

ExitSlideShow [::Ppt]

Ppt, Top

Exit specified slide show.

ExitSlideShow slideShowId

Parameters
slideShowId Identifier of the slide show as returned by UseSlideShow.
Description

Exit specified slide show.

No return value.

See also: GetNumSlideShows UseSlideShow SlideShowNext

ExportPptFile [::Ppt]

Ppt, Top

Export a PowerPoint file to an image sequence.

ExportPptFile pptFile outputDir outputFileFmt startIndex endIndex imgType width height useMaster genHtmlTable thumbsPerRow thumbSize

Parameters
pptFile Name of the PowerPoint file (as absolute path).
outputDir Name of the output folder (as absolute path).
outputFileFmt Name of the output file names (printf style with 1 "%d" for the slide index).
startIndex(optional, default 1) Start index for slide export.
endIndex(optional, default end) End index for slide export.
imgType(optional, default GIF) Name of the image format filter. This is the name as stored in the Windows registry. Ex: "GIF", "PNG".
width(optional, default -1) Width of the generated images in pixels.
height(optional, default -1) Height of the generated images in pixels.
useMaster(optional, default true) true: Export with the contents of the master slide. false: Do not export the contents of the master slide.
genHtmlTable(optional, default true) Additionally generate a HTML table with preview images.
thumbsPerRow(optional, default 4) Number of preview images per HTML table row.
thumbSize(optional, default 150) Maximum size of the preview images in pixels.
Description

Export a PowerPoint file to an image sequence.

If the output directory does not exist, it is created. Caution: All existing files in the output directory are deleted before exporting.

If width and height are not specified or less than zero, the default sizes of PowerPoint are used.

No return value.

See also: ExportSlide ExportSlides

ExportSlide [::Ppt]

Ppt, Top

Export a slide as an image.

ExportSlide slideId outputFile imgType width height

Parameters
slideId Identifier of the slide.
outputFile Name of the output file (as absolute path).
imgType(optional, default GIF) Name of the image format filter. This is the name as stored in the Windows registry. Ex: "GIF", "PNG".
width(optional, default -1) Width of the generated images in pixels.
height(optional, default -1) Height of the generated images in pixels.
Description

Export a slide as an image.

If width and height are not specified or less than zero, the default sizes of PowerPoint are used.

No return value. If the export failed, an error is thrown.

See also: ExportPptFile ExportSlides

ExportSlides [::Ppt]

Ppt, Top

Export a range of slides as image files.

ExportSlides presId outputDir outputFileFmt startIndex endIndex imgType width height

Parameters
presId Identifier of the presentation.
outputDir Name of the output folder (as absolute path).
outputFileFmt Name of the output file names (C printf style with one "%d" for the slide index).
startIndex(optional, default 1) Start index for slide export.
endIndex(optional, default end) End index for slide export.
imgType(optional, default GIF) Name of the image format filter. This is the name as stored in the Windows registry. Ex: "GIF", "PNG".
width(optional, default -1) Width of the generated images in pixels.
height(optional, default -1) Height of the generated images in pixels.
Description

Export a range of slides as image files.

If the output directory does not exist, it is created. If width and height are not specified or less than zero, the default sizes of PowerPoint are used.

No return value. If the export failed, an error is thrown.

See also: ExportPptFile ExportSlide

GetActivePres [::Ppt]

Ppt, Top

Return the active presentation of an application.

GetActivePres appId

Parameters
appId Identifier of the PowerPoint instance.
Description

Return the active presentation of an application.

Return the identifier of the active presentation.

See also: OpenPres AddPres

GetCustomLayoutId [::Ppt]

Ppt, Top

Get a custom layout by it's index or name.

GetCustomLayoutId presId indexOrName

Parameters
presId Identifier of the presentation containing the custom layout.
indexOrName Index or name of the custom layout to find.
Description

Get a custom layout by it's index or name.

Return the identifier of the found custom layout. Instead of using the numeric index the special word "end" may be used to specify the last custom layout. If the index is out of bounds or a custom layout with specified name is not found, an error is thrown.

See also: GetNumCustomLayouts AddPres

GetCustomLayoutName [::Ppt]

Ppt, Top

Return the name of a custom layout.

GetCustomLayoutName customLayoutId

Parameters
customLayoutId Identifier of the custom layout.
Description

Return the name of a custom layout.

See also: GetCustomLayoutId GetNumCustomLayouts

GetExtString [::Ppt]

Ppt, Top

Return the default extension of a PowerPoint file.

GetExtString appId

Parameters
appId Identifier of the PowerPoint instance.
Description

Return the default extension of a PowerPoint file.

Starting with PowerPoint 12 (2007) this is the string ".pptx". In previous versions it was ".ppt".

GetNumCustomLayouts [::Ppt]

Ppt, Top

Return the number of custom layouts of a presentation.

GetNumCustomLayouts presId

Parameters
presId Identifier of the presentation.
Description

Return the number of custom layouts of a presentation.

See also: GetNumSlides

GetNumSlides [::Ppt]

Ppt, Top

Return the number of slides of a presentation.

GetNumSlides presId

Parameters
presId Identifier of the presentation.
Description

Return the number of slides of a presentation.

See also: GetNumSlideShows

GetNumSlideShows [::Ppt]

Ppt, Top

Return the number of slide shows of a presentation.

GetNumSlideShows appId

Parameters
appId Identifier of the PowerPoint instance.
Description

Return the number of slide shows of a presentation.

See also: GetNumSlides UseSlideShow ExitSlideShow

GetSlideId [::Ppt]

Ppt, Top

Get slide identifier from slide index.

GetSlideId presId slideIndex

Parameters
presId Identifier of the presentation.
slideIndex Index of slide. Slide indices start at 1. If negative or "end", use last slide.
Description

Get slide identifier from slide index.

Return the identifier of the slide.

GetSlideIndex [::Ppt]

Ppt, Top

Return the index of a slide.

GetSlideIndex slideId

Parameters
slideId Identifier of the slide.
Description

Return the index of a slide.

See also: GetNumSlides AddSlide

GetTemplateExtString [::Ppt]

Ppt, Top

Return the default extension of a PowerPoint template file.

GetTemplateExtString appId

Parameters
appId Identifier of the PowerPoint instance.
Description

Return the default extension of a PowerPoint template file.

Starting with PowerPoint 12 (2007) this is the string ".potx". In previous versions it was ".pot".

GetVersion [::Ppt]

Ppt, Top

Return the version of a PowerPoint application.

GetVersion appId useString

Parameters
appId Identifier of the Excel instance.
useString(optional, default false) true: Return the version name (ex. "PowerPoint 2003"). false: Return the version number (ex. "11.0").
Description

Return the version of a PowerPoint application.

Both version name and version number are returned as strings. Version number is in a format, so that it can be evaluated as a floating point number.

GetViewType [::Ppt]

Ppt, Top

Return the view type of a presentation.

GetViewType presId

Parameters
presId Identifier of the presentation.
Description

Return the view type of a presentation.

See also: SetViewType

InsertImage [::Ppt]

Ppt, Top

Insert an image into a slide.

InsertImage slideId imgFileName left top width height

Parameters
slideId Identifier of the slide where the image is inserted.
imgFileName File name of the image (as absolute path).
left X position of top-left image position in points.
top Y position of top-left image position in points.
width(optional, default -1) Width of image in points.
height(optional, default -1) Height of image in points.
Description

Insert an image into a slide.

The file name of the image must be an absolute pathname. Use a construct like [file join [pwd] "myImage.gif"] to insert images from the current directory.

Return the identifier of the inserted image.

See also: ::Cawt::InchesToPoints ::Cawt::CentiMetersToPoints

MoveSlide [::Ppt]

Ppt, Top

Move a slide to another position.

MoveSlide slideId slideIndex

Parameters
slideId Identifier of the slide to be moved.
slideIndex Index of new slide position. Slide indices start at 1. If negative or "end", move slide to the end of the presentation.
Description

Move a slide to another position.

Open [::Ppt]

Ppt, Top

Open a PowerPoint instance. Use an already running PowerPoint, if available.

Open width height

Parameters
width(optional, default -1) Width of the application window. If negative, open with last used width.
height(optional, default -1) Height of the application window. If negative, open with last used height.
Description

Open a PowerPoint instance. Use an already running PowerPoint, if available.

Return the identifier of the PowerPoint application instance.

See also: OpenNew Quit

OpenNew [::Ppt]

Ppt, Top

Open a new PowerPoint instance.

OpenNew width height

Parameters
width(optional, default -1) Width of the application window. If negative, open with last used width.
height(optional, default -1) Height of the application window. If negative, open with last used height.
Description

Open a new PowerPoint instance.

Return the identifier of the new PowerPoint application instance.

See also: Open Quit

OpenPres [::Ppt]

Ppt, Top

Open a presentation, i.e load a PowerPoint file.

OpenPres appId fileName readOnly

Parameters
appId Identifier of the PowerPoint instance.
fileName Name of the PowerPoint file (as absolute path).
readOnly(optional, default false) true: Open the presentation in read-only mode. false: Open the presentation in read-write mode.
Description

Open a presentation, i.e load a PowerPoint file.

Return the identifier of the opened presentation. If the presentation was already open, activate that presentation and return the identifier to that presentation.

See also: AddPres GetActivePres

Quit [::Ppt]

Ppt, Top

Quit a PowerPoint application instance.

Quit appId showAlert

Parameters
appId Identifier of the PowerPoint instance.
showAlert(optional, default true) true: Show an alert window, if there are unsaved changes. false: Quit without saving any changes.
Description

Quit a PowerPoint application instance.

No return value.

See also: Open

SaveAs [::Ppt]

Ppt, Top

Save a presentation to a PowerPoint file.

SaveAs presId fileName fmt embedFonts

Parameters
presId Identifier of the presentation to save.
fileName Name of the PowerPoint file.
fmt(optional, default ) Value of enumeration type PpSaveAsFileType (see pptConst.tcl). If not given or the empty string, the file is stored in the native format corresponding to the used PowerPoint version (ppSaveAsDefault).
embedFonts(optional, default true) true: Embed TrueType fonts. false: Do not embed TrueType fonts.
Description

Save a presentation to a PowerPoint file.

Note: If "fmt" is not a PowerPoint format, but an image format, PowerPoint takes the

      specified file name and creates a directory with that name. Then it copies all
      slides as images into that directory. The slide images are automatically named by
      PowerPoint (ex. in German versions the slides are called Folie1.gif, Folie2.gif, ...).
      Use the ExportSlide procedure, if you want full control over image file names.

No return value.

See also: ExportSlides ExportSlide

SetViewType [::Ppt]

Ppt, Top

Set the view type of a presentation.

SetViewType presId viewType

Parameters
presId Identifier of the presentation.
viewType Value of enumeration type PpViewType (see pptConst.tcl).
Description

Set the view type of a presentation.

No return value.

See also: GetViewType

ShowSlide [::Ppt]

Ppt, Top

Show a specific slide.

ShowSlide presId slideIndex

Parameters
presId Identifier of the presentation.
slideIndex Index of slide. Slide indices start at 1. If negative or "end", show last slide.
Description

Show a specific slide.

No return value.

SlideShowFirst [::Ppt]

Ppt, Top

Goto first slide in slide show.

SlideShowFirst slideShowId

Parameters
slideShowId Identifier of the slide show.
Description

Goto first slide in slide show.

No return value.

See also: UseSlideShow SlideShowNext SlideShowPrev SlideShowLast

SlideShowLast [::Ppt]

Ppt, Top

Goto last slide in slide show.

SlideShowLast slideShowId

Parameters
slideShowId Identifier of the slide show.
Description

Goto last slide in slide show.

No return value.

See also: UseSlideShow SlideShowNext SlideShowPrev SlideShowFirst

SlideShowNext [::Ppt]

Ppt, Top

Goto next slide in slide show.

SlideShowNext slideShowId

Parameters
slideShowId Identifier of the slide show.
Description

Goto next slide in slide show.

No return value.

See also: UseSlideShow SlideShowPrev SlideShowFirst SlideShowLast

SlideShowPrev [::Ppt]

Ppt, Top

Goto previous slide in slide show.

SlideShowPrev slideShowId

Parameters
slideShowId Identifier of the slide show.
Description

Goto previous slide in slide show.

No return value.

See also: UseSlideShow SlideShowNext SlideShowFirst SlideShowLast

UseSlideShow [::Ppt]

Ppt, Top

Use specified slide show.

UseSlideShow presId slideShowIndex

Parameters
presId Identifier of the presentation.
slideShowIndex Index of the slide show. Indices start at 1.
Description

Use specified slide show.

Return the identifier of the specified slide show.

See also: GetNumSlides ExitSlideShow SlideShowNext

Visible [::Ppt]

Ppt, Top

Toggle the visibilty of a PowerPoint application window.

Visible appId visible

Parameters
appId Identifier of the PowerPoint instance.
visible true: Show the application window. false: Hide the application window.
Description

Toggle the visibilty of a PowerPoint application window.

No return value.

See also: Open OpenNew

::Word

Introduction

The Word namespace provides commands to control Microsoft Word.

Commands

AddBookmark [::Word]

Word, Top

Add a bookmark to a text range.

AddBookmark rangeId name

Parameters
rangeId Identifier of the text range.
name Name of the bookmark.
Description

Add a bookmark to a text range.

Return the bookmark identifier.

See also: SetLinkToBookmark GetBookmarkName

AddDocument [::Word]

Word, Top

Add a new empty document to a Word instance.

AddDocument appId type visible

Parameters
appId Identifier of the Word instance.
type(optional, default ) Value of enumeration type WdNewDocumentType (see wordConst.tcl).
visible(optional, default true) true: Show the application window. false: Hide the application window.
Description

Add a new empty document to a Word instance.

Return the identifier of the new document.

See also: OpenDocument

AddPageBreak [::Word]

Word, Top

Add a page break to a text range.

AddPageBreak rangeId

Parameters
rangeId Identifier of the text range.
Description

Add a page break to a text range.

No return value.

See also: AddParagraph

AddParagraph [::Word]

Word, Top

Add a new paragraph to a document.

AddParagraph rangeId spaceAfter

Parameters
rangeId Identifier of the text range.
spaceAfter(optional, default -1) Spacing in points after the range.
Description

Add a new paragraph to a document.

Return the new extended range.

See also: AppendParagraph

AddRow [::Word]

Word, Top

Add a new row to a table.

AddRow tableId beforeRowNum

Parameters
tableId Identifier of the Word table.
beforeRowNum(optional, default end) Insertion row number. Row numbering starts with 1. The new row is inserted before the given row number. If not specified or "end", the new row is appended at the end.
Description

Add a new row to a table.

No return value.

See also: GetNumRows

AddTable [::Word]

Word, Top

Add a new table in a text range.

AddTable rangeId numRows numCols spaceAfter

Parameters
rangeId Identifier of the text range.
numRows Number of rows of the new table.
numCols Number of columns of the new table.
spaceAfter(optional, default -1) Spacing in points after the table.
Description

Add a new table in a text range.

Return the identifier of the new table.

See also: GetNumRows GetNumColumns

AddText [::Word]

Word, Top

Add text to a Word document.

AddText rangeId text addParagraph style

Parameters
rangeId Identifier of the text range.
text Text string to be added.
addParagraph(optional, default false) Add a paragraph after the text.
style(optional, default $::Word::wdStyleNormal) Value of enumeration type WdBuiltinStyle (see wordConst.tcl).
Description

Add text to a Word document.

The text string is appended to the supplied text range with given style. Return the new text range.

See also: AddText InsertText AppendParagraph SetRangeStyle

AppendParagraph [::Word]

Word, Top

Append a paragraph at the end of the document.

AppendParagraph docId spaceAfter

Parameters
docId Identifier of the document.
spaceAfter(optional, default -1) Spacing in points after the range.
Description

Append a paragraph at the end of the document.

Append a new paragraph to the end of the document.

No return value.

See also: GetEndRange AddParagraph

AppendText [::Word]

Word, Top

Append text to a Word document.

AppendText docId text addParagraph style

Parameters
docId Identifier of the document.
text Text string to be appended.
addParagraph(optional, default false) Add a paragraph after the text.
style(optional, default $::Word::wdStyleNormal) Value of enumeration type WdBuiltinStyle (see wordConst.tcl).
Description

Append text to a Word document.

The text string is appended at the end of the document with given style.

Return the new text range.

See also: GetEndRange AddText InsertText AppendParagraph SetRangeStyle

Close [::Word]

Word, Top

Close a document without saving changes.

Close docId

Parameters
docId Identifier of the document.
Description

Close a document without saving changes.

Use the SaveAs method before closing, if you want to save changes.

No return value.

See also: SaveAs

ConfigureCaption [::Word]

Word, Top

Configure style of a caption type identified by it's label identifier.

ConfigureCaption appId labelId chapterStyleLevel includeChapterNumber numberStyle separator

Parameters
appId Identifier of the Word instance.
labelId Value of enumeration type WdCaptionLabelID. Possible values: wdCaptionEquation, wdCaptionFigure, wdCaptionTable
chapterStyleLevel 1 corresponds to Heading1, 2 corresponds to Heading2, ...
includeChapterNumber(optional, default true) Flag indicating whether to include the chapter number.
numberStyle(optional, default $::Word::wdCaptionNumberStyleArabic) Value of enumeration type WdCaptionNumberStyle (see wordConst.tcl).
separator(optional, default $::Word::wdSeparatorHyphen) Value of enumeration type WdSeparatorType (see wordConst.tcl).
Description

Configure style of a caption type identified by it's label identifier.

No return value.

See also: InsertCaption

CreateRange [::Word]

Word, Top

Create a new text range.

CreateRange docId startIndex endIndex

Parameters
docId Identifier of the document.
startIndex The start index of the range in characters.
endIndex The end index of the range in characters.
Description

Create a new text range.

Return the identifier of the new text range.

See also: CreateRangeAfter SelectRange GetSelectionRange

CreateRangeAfter [::Word]

Word, Top

Create a new text range after specified range.

CreateRangeAfter rangeId

Parameters
rangeId Identifier of the text range.
Description

Create a new text range after specified range.

Return the identifier of the new text range.

See also: CreateRange SelectRange GetSelectionRange

CropImage [::Word]

Word, Top

Crop an image at the four borders.

CropImage imgId cropBottom cropTop cropLeft cropRight

Parameters
imgId Identifier of the image.
cropBottom(optional, default 0.0) Crop amount at the bottom border.
cropTop(optional, default 0.0) Crop amount at the top border.
cropLeft(optional, default 0.0) Crop amount at the left border.
cropRight(optional, default 0.0) Crop amount at the right border.
Description

Crop an image at the four borders.

The crop values must be specified in points. Use ::Cawt::CentiMetersToPoints or ::Cawt::InchesToPoints for conversion.

No return value.

See also: InsertImage ::Cawt::CentiMetersToPoints ::Cawt::InchesToPoints

ExtendRange [::Word]

Word, Top

Extend the range indices of a text range.

ExtendRange rangeId startIncr endIncr

Parameters
rangeId Identifier of the text range.
startIncr(optional, default 0) Increment of the range start index.
endIncr(optional, default 0) Increment of the range end index.
Description

Extend the range indices of a text range.

Increment is either an integer value or strings "begin" or "end" to use the start or end of the document.

Return the new extended range.

See also: SetRangeBeginIndex SetRangeEndIndex

FindString [::Word]

Word, Top

Find a string in a text range.

FindString rangeId str matchCase

Parameters
rangeId Identifier of the text range.
str Search string.
matchCase(optional, default true) Flag indicating case sensitive search.
Description

Find a string in a text range.

Return true, if string was found. Otherwise false. If the string was found, the selection is set to the found string.

See also: ReplaceString GetSelectionRange

FormatHeaderRow [::Word]

Word, Top

Format a row as a header row.

FormatHeaderRow tableId row startCol endCol

Parameters
tableId Identifier of the Word table.
row Row number. Row numbering starts with 1.
startCol Column number of formatting start. Column numbering starts with 1.
endCol Column number of formatting end. Column numbering starts with 1.
Description

Format a row as a header row.

The cell values of a header are formatted as bold text with both vertical and horizontal centered alignment.

No return value.

See also: SetHeaderRow

GetBookmarkName [::Word]

Word, Top

Get the name of a bookmark.

GetBookmarkName bookmarkId

Parameters
bookmarkId Identifier of the boormark.
Description

Get the name of a bookmark.

Return the name of the bookmark.

See also: AddBookmark SetLinkToBookmark

GetCellRange [::Word]

Word, Top

Return a cell of a Word table as a range.

GetCellRange tableId row col

Parameters
tableId Identifier of the Word table.
row Row number. Row numbering starts with 1.
col Column number. Column numbering starts with 1.
Description

Return a cell of a Word table as a range.

Return a range consisting of 1 cell of a Word table.

See also: GetRowRange GetColumnRange

GetCellValue [::Word]

Word, Top

Return the value of a Word table cell.

GetCellValue tableId row col

Parameters
tableId Identifier of the Word table.
row Row number. Row numbering starts with 1.
col Column number. Column numbering starts with 1.
Description

Return the value of a Word table cell.

Return the value of the specified cell as a string.

See also: SetCellValue

GetColumnRange [::Word]

Word, Top

Return a column of a Word table as a selection.

GetColumnRange tableId col

Parameters
tableId Identifier of the Word table.
col Column number. Column numbering starts with 1.
Description

Return a column of a Word table as a selection.

Return a selection consisting of all cells of a column. Note, that a selection is returned and not a range, because columns do not have a range property.

See also: GetCellRange GetRowRange

GetColumnValues [::Word]

Word, Top

Return column values of a Word table as a Tcl list.

GetColumnValues tableId col startRow numVals

Parameters
tableId Identifier of the Word table.
col Column number. Column numbering starts with 1.
startRow(optional, default 1) Row number of start. Row numbering starts with 1.
numVals(optional, default 0) Negative or zero: All available column values are returned. Positive: Only numVals values of the column are returned.
Description

Return column values of a Word table as a Tcl list.

Return the values of the specified column or column range as a Tcl list.

See also: SetColumnValues GetRowValues GetCellValue

GetCompatibilityMode [::Word]

Word, Top

Return the compatibility version of a Word application.

GetCompatibilityMode appId version

Parameters
appId Identifier of the Word instance.
version(optional, default ) Word version number.
Description

Return the compatibility version of a Word application.

Return the compatibility mode of the current Word application, if version is not specified or the empty string. If version is a valid Word version as returned by GetVersion, the corresponding compatibility mode is returned.

Note: The compatibility mode is a value of enumeration WdCompatibilityMode.

See also: GetVersion GetExtString

GetDocumentId [::Word]

Word, Top

Get the document identifier of a Word component.

GetDocumentId componentId

Parameters
componentId The identifier of a Word component.
Description

Get the document identifier of a Word component.

Word components having the Document property are ex. ranges, panes.

GetDocumentIdByIndex [::Word]

Word, Top

Find a document by it's index.

GetDocumentIdByIndex appId index

Parameters
appId Identifier of the Word instance.
index Index of the document to find.
Description

Find a document by it's index.

Return the identifier of the found document. If the index is out of bounds an error is thrown.

See also: GetNumDocuments GetDocumentName

GetDocumentName [::Word]

Word, Top

Get the name of a document.

GetDocumentName docId

Parameters
docId Identifier of the document.
Description

Get the name of a document.

Return the name of the document (i.e. the full path name of the corresponding Word file) as a string.

GetEndRange [::Word]

Word, Top

Return the text range representing the end of the document.

GetEndRange docId

Parameters
docId Identifier of the document.
Description

Return the text range representing the end of the document.

Note: This corresponds to the built-in bookmark \endofdoc.

      The end range of an empty document is (0, 0), although
      GetNumCharacters returns 1.

See also: GetSelectionRange GetStartRange GetNumCharacters

GetExtString [::Word]

Word, Top

Return the default extension of a Word file.

GetExtString appId

Parameters
appId Identifier of the Word instance.
Description

Return the default extension of a Word file.

Starting with Word 12 (2007) this is the string ".docx". In previous versions it was ".doc".

See also: GetCompatibilityMode GetVersion

GetListGalleryId [::Word]

Word, Top

Get one of the 3 predefined list galleries.

GetListGalleryId appId galleryType

Parameters
appId Identifier of the Word instance.
galleryType Value of enumeration type WdListGalleryType (see wordConst.tcl).
Description

Get one of the 3 predefined list galleries.

Return the identifier of the specified list gallery.

See also: GetListTemplateId InsertList

GetListTemplateId [::Word]

Word, Top

Get one of the 7 predefined list templates.

GetListTemplateId galleryId listType

Parameters
galleryId Identifier of the Word gallery.
listType Value of enumeration type WdListType (see wordConst.tcl)
Description

Get one of the 7 predefined list templates.

Return the identifier of the specified list template.

See also: GetListGalleryId InsertList

GetMatrixValues [::Word]

Word, Top

Return table values as a matrix.

GetMatrixValues tableId row1 col1 row2 col2

Parameters
tableId Identifier of the Word table.
row1 Row number of upper-left corner of the cell range.
col1 Column number of upper-left corner of the cell range.
row2 Row number of lower-right corner of the cell range.
col2 Column number of lower-right corner of the cell range.
Description

Return table values as a matrix.

See also: SetMatrixValues

GetNumCharacters [::Word]

Word, Top

Return the number of characters in a Word document.

GetNumCharacters docId

Parameters
docId Identifier of the document.
Description

Return the number of characters in a Word document.

See also: GetNumDocuments GetNumTables GetNumCharacters

GetNumColumns [::Word]

Word, Top

Return the number of columns of a Word table.

GetNumColumns tableId

Parameters
tableId Identifier of the Word table.
Description

Return the number of columns of a Word table.

See also: GetNumRows GetNumTables

GetNumDocuments [::Word]

Word, Top

Return the number of documents in a Word application.

GetNumDocuments appId

Parameters
appId Identifier of the Word instance.
Description

Return the number of documents in a Word application.

See also: AddDocument OpenDocument

GetNumRows [::Word]

Word, Top

Return the number of rows of a Word table.

GetNumRows tableId

Parameters
tableId Identifier of the Word table.
Description

Return the number of rows of a Word table.

See also: GetNumColumns GetNumTables

GetNumTables [::Word]

Word, Top

Return the number of tables of a Word document.

GetNumTables docId

Parameters
docId Identifier of the document.
Description

Return the number of tables of a Word document.

See also: AddTable GetNumRows GetNumCols

GetRangeEndIndex [::Word]

Word, Top

Return the end index of a text range.

GetRangeEndIndex rangeId

Parameters
rangeId Identifier of the text range.
Description

Return the end index of a text range.

See also: GetRangeStartIndex PrintRange

GetRangeInformation [::Word]

Word, Top

Get information about a text range.

GetRangeInformation rangeId type

Parameters
rangeId Identifier of the text range.
type Value of enumeration type WdInformation (see wordConst.tcl).
Description

Get information about a text range.

Return the range information associated with the supplied type.

See also: GetStartRange GetEndRange PrintRange

GetRangeStartIndex [::Word]

Word, Top

Return the start index of a text range.

GetRangeStartIndex rangeId

Parameters
rangeId Identifier of the text range.
Description

Return the start index of a text range.

See also: GetRangeEndIndex PrintRange

GetRowRange [::Word]

Word, Top

Return a row of a Word table as a range.

GetRowRange tableId row

Parameters
tableId Identifier of the Word table.
row Row number. Row numbering starts with 1.
Description

Return a row of a Word table as a range.

Return a range consisting of all cells of a row.

See also: GetCellRange GetColumnRange

GetRowValues [::Word]

Word, Top

Return row values of a Word table as a Tcl list.

GetRowValues tableId row startCol numVals

Parameters
tableId Identifier of the Word table.
row Row number. Row numbering starts with 1.
startCol(optional, default 1) Column number of start. Column numbering starts with 1.
numVals(optional, default 0) Negative or zero: All available row values are returned. Positive: Only numVals values of the row are returned.
Description

Return row values of a Word table as a Tcl list.

Return the values of the specified row or row range as a Tcl list.

See also: SetRowValues GetColumnValues GetCellValue

GetSelectionRange [::Word]

Word, Top

Return the text range representing the current selection.

GetSelectionRange docId

Parameters
docId Identifier of the document.
Description

Return the text range representing the current selection.

See also: GetStartRange GetEndRange SelectRange

GetStartRange [::Word]

Word, Top

Return a text range representing the start of the document.

GetStartRange docId

Parameters
docId Identifier of the document.
Description

Return a text range representing the start of the document.

See also: CreateRange GetSelectionRange GetEndRange

GetTableIdByIndex [::Word]

Word, Top

Find a table by it's index.

GetTableIdByIndex docId index

Parameters
docId Identifier of the document.
index Index of the table to find.
Description

Find a table by it's index.

Return the identifier of the found table. If the index is out of bounds an error is thrown.

See also: GetNumTables

GetVersion [::Word]

Word, Top

Return the version of a Word application.

GetVersion appId useString

Parameters
appId Identifier of the Word instance.
useString(optional, default false) true: Return the version name (ex. "Word 2000"). false: Return the version number (ex. "9.0").
Description

Return the version of a Word application.

Both version name and version number are returned as strings. Version number is in a format, so that it can be evaluated as a floating point number.

See also: GetCompatibilityMode GetExtString

InsertCaption [::Word]

Word, Top

Insert a caption into a range of a document.

InsertCaption rangeId labelId text pos

Parameters
rangeId Identifier of the text range.
labelId Value of enumeration type WdCaptionLabelID. Possible values: wdCaptionEquation, wdCaptionFigure, wdCaptionTable
text Text of the caption.
pos(optional, default $::Word::wdCaptionPositionBelow) Value of enumeration type WdCaptionPosition (see wordConst.tcl).
Description

Insert a caption into a range of a document.

Return the new extended range.

See also: ConfigureCaption

InsertImage [::Word]

Word, Top

Insert an image into a range of a document.

InsertImage rangeId imgFileName linkToFile saveWithDocument

Parameters
rangeId Identifier of the text range.
imgFileName File name of the image (as absolute path).
linkToFile(optional, default false) Insert a link to the image instead of a copy.
saveWithDocument(optional, default false) If using a link, store the image in the file, too.
Description

Insert an image into a range of a document.

The file name of the image must be an absolute pathname. Use a construct like [file join [pwd] "myImage.gif"] to insert images from the current directory.

Return the identifier of the inserted image.

See also: CropImage

InsertList [::Word]

Word, Top

Insert a Word list.

InsertList rangeId stringList galleryType listType

Parameters
rangeId Identifier of the text range.
stringList List of text strings building up the Word list.
galleryType(optional, default $::Word::wdBulletGallery) Value of enumeration type WdListGalleryType (see wordConst.tcl).
listType(optional, default $::Word::wdListListNumOnly) Value of enumeration type WdListType (see wordConst.tcl)
Description

Insert a Word list.

Return the range of the Word list.

See also: GetListGalleryId GetListTemplateId

InsertText [::Word]

Word, Top

Insert text in a Word document.

InsertText docId text addParagraph style

Parameters
docId Identifier of the document.
text Text string to be inserted.
addParagraph(optional, default false) Add a paragraph after the text.
style(optional, default $::Word::wdStyleNormal) Value of enumeration type WdBuiltinStyle (see wordConst.tcl).
Description

Insert text in a Word document.

The text string is inserted at the start of the document with given style.

Return the new text range.

See also: AddText AppendText AddParagraph SetRangeStyle

Open [::Word]

Word, Top

Open a Word instance. Use an already running Word, if available.

Open visible width height

Parameters
visible(optional, default true) true: Show the application window. false: Hide the application window.
width(optional, default -1) Width of the application window. If negative, open with last used width.
height(optional, default -1) Height of the application window. If negative, open with last used height.
Description

Open a Word instance. Use an already running Word, if available.

Return the identifier of the Word application instance.

See also: OpenNew Quit Visible

OpenDocument [::Word]

Word, Top

Open a document, i.e load a Word file.

OpenDocument appId fileName readOnly

Parameters
appId Identifier of the Word instance.
fileName Name of the Word file.
readOnly(optional, default false) true: Open the document in read-only mode. false: Open the document in read-write mode.
Description

Open a document, i.e load a Word file.

Return the identifier of the opened document. If the document was already open, activate that document and return the identifier to that document.

See also: AddDocument

OpenNew [::Word]

Word, Top

Open a new Word instance.

OpenNew visible width height

Parameters
visible(optional, default true) true: Show the application window. false: Hide the application window.
width(optional, default -1) Width of the application window. If negative, open with last used width.
height(optional, default -1) Height of the application window. If negative, open with last used height.
Description

Open a new Word instance.

Return the identifier of the new Word application instance.

See also: Open Quit Visible

PrintRange [::Word]

Word, Top

Print the indices of a text range.

PrintRange rangeId msg

Parameters
rangeId Identifier of the text range.
msg(optional, default Range: ) String printed in front of the indices.
Description

Print the indices of a text range.

The range identifiers are printed onto standard output.

No return value.

See also: GetRangeStartIndex GetRangeEndIndex

Quit [::Word]

Word, Top

Quit a Word application instance.

Quit appId showAlert

Parameters
appId Identifier of the Word instance.
showAlert(optional, default true) true: Show an alert window, if there are unsaved changes. false: Quit without saving any changes.
Description

Quit a Word application instance.

No return value.

See also: Open OpenNew

ReplaceByProc [::Word]

Word, Top

Replace a string in a text range. Generic case.

ReplaceByProc rangeId str func args

Parameters
rangeId Identifier of the text range.
str Search string.
func Replacement procedure.
args Arguments for replacement procedure.
Description

Replace a string in a text range. Generic case.

Search for string "str" in the range "rangeId". For each occurence found, call procedure "func" with the range of the found occurence and additional parameters specified in "args". The procedures which can be used for "func" must therefore have the following signature: proc SetRangeXYZ rangeId param1 param2 ... See example Word-04-Find.tcl for an example.

No return value.

See also: SearchString ReplaceString

ReplaceString [::Word]

Word, Top

Replace a string in a text range. Simple case.

ReplaceString rangeId searchStr replaceStr howMuch matchCase

Parameters
rangeId Identifier of the text range.
searchStr Search string.
replaceStr Replacement string.
howMuch(optional, default one) "one" to replace first occurence only. "all" to replace all occurences.
matchCase(optional, default true) Flag indicating case sensitive search.
Description

Replace a string in a text range. Simple case.

Return true, if string could be replaced, i.e. the search string was found. Otherwise false.

See also: SearchString ReplaceByProc

SaveAs [::Word]

Word, Top

Save a document to a Word file.

SaveAs docId fileName fmt

Parameters
docId Identifier of the document to save.
fileName Name of the Word file.
fmt(optional, default ) Value of enumeration type WdSaveFormat (see wordConst.tcl). If not given or the empty string, the file is stored in the native format corresponding to the used Word version.
Description

Save a document to a Word file.

No return value.

See also: SaveAsPdf

SaveAsPdf [::Word]

Word, Top

Save a document to a PDF file.

SaveAsPdf docId fileName

Parameters
docId Identifier of the document to export.
fileName Name of the PDF file.
Description

Save a document to a PDF file.

PDF export is supported since Word 2007. If your Word version is older an error is thrown.

Note, that for Word 2007 you need the Microsoft Office Add-in "Microsoft Save as PDF or XPS" available from http://www.microsoft.com/en-us/download/details.aspx?id=7

No return value.

See also: SaveAs

SelectRange [::Word]

Word, Top

Select a text range.

SelectRange rangeId

Parameters
rangeId Identifier of the text range.
Description

Select a text range.

No return value.

See also: GetSelectionRange

SetCellValue [::Word]

Word, Top

Set the value of a Word table cell.

SetCellValue tableId row col val

Parameters
tableId Identifier of the Word table.
row Row number. Row numbering starts with 1.
col Column number. Column numbering starts with 1.
val String value of the cell.
Description

Set the value of a Word table cell.

See also: GetCellValue SetRowValues SetMatrixValues

SetColumnsWidth [::Word]

Word, Top

Set the width of a range of table columns.

SetColumnsWidth tableId startCol endCol width

Parameters
tableId Identifier of the Word table.
startCol Range start column number. Column numbering starts with 1.
endCol Range end column number. Column numbering starts with 1.
width Column width of table column in points.
Description

Set the width of a range of table columns.

No return value.

See also: SetColumnWidth InchesToPoints

SetColumnValues [::Word]

Word, Top

Insert column values into a Word table.

SetColumnValues tableId col valList startRow numVals

Parameters
tableId Identifier of the Word table.
col Column number. Column numbering starts with 1.
valList List of values to be inserted.
startRow(optional, default 1) Row number of insertion start. Row numbering starts with 1.
numVals(optional, default 0) Negative or zero: All list values are inserted. Positive: numVals rows are filled with the list values (starting at list index 0).
Description

Insert column values into a Word table.

No return value.

See also: GetColumnValues SetRowValues SetCellValue

SetColumnWidth [::Word]

Word, Top

Set the width of a table column.

SetColumnWidth tableId col width

Parameters
tableId Identifier of the Word table.
col Column number. Column numbering starts with 1.
width Column width of table column in points.
Description

Set the width of a table column.

No return value.

See also: SetColumnsWidth InchesToPoints

SetCompatibilityMode [::Word]

Word, Top

Set the compatibility mode of a document.

SetCompatibilityMode docId mode

Parameters
docId Identifier of the document.
mode(optional, default $::Word::wdWord2010) Compatibility mode of the document. Value of enumeration type WdCompatibilityMode (see wordConst.tcl).
Description

Set the compatibility mode of a document.

Available only for Word 2010 and up.

No return value.

See also: GetCompatibilityMode

SetHeaderRow [::Word]

Word, Top

Insert row values into a Word table and format as a header row.

SetHeaderRow tableId headerList row startCol

Parameters
tableId Identifier of the Word table.
headerList List of values to be inserted as header.
row(optional, default 1) Row number. Row numbering starts with 1.
startCol(optional, default 1) Column number of insertion start. Column numbering starts with 1.
Description

Insert row values into a Word table and format as a header row.

No return value. If headerList is an empty list, an error is thrown.

See also: SetRowValues FormatHeaderRow

SetHyperlink [::Word]

Word, Top

Insert a hyperlink into a Word document.

SetHyperlink rangeId link textDisplay

Parameters
rangeId Identifier of the text range.
link URL of the hyperlink.
textDisplay(optional, default ) Text to be displayed instead of the URL.
Description

Insert a hyperlink into a Word document.

# URL's are specified as strings: file://myLinkedFile specifies a link to a local file. http://myLinkedWebpage specifies a link to a web address.

No return value.

See also: SetLinkToBookmark

SetLinkToBookmark [::Word]

Word, Top

Insert an internal link to a bookmark into a Word document.

SetLinkToBookmark rangeId bookmarkId textDisplay

Parameters
rangeId Identifier of the text range.
bookmarkId Identifier of the bookmark to link to.
textDisplay(optional, default ) Text to be displayed instead of the bookmark name.
Description

Insert an internal link to a bookmark into a Word document.

No return value.

See also: AddBookmark GetBookmarkName SetHyperlink

SetMatrixValues [::Word]

Word, Top

Insert matrix values into a Word table.

SetMatrixValues tableId matrixList startRow startCol

Parameters
tableId Identifier of the Word table.
matrixList Matrix with table data.
startRow(optional, default 1) Row number of insertion start. Row numbering starts with 1.
startCol(optional, default 1) Column number of insertion start. Column numbering starts with 1.
Description

Insert matrix values into a Word table.

The matrix data must be stored as a list of lists. Each sub-list contains the values for the row values. The main (outer) list contains the rows of the matrix. Example: { { R1_C1 R1_C2 R1_C3 } { R2_C1 R2_C2 R2_C3 } }

No return value.

See also: GetMatrixValues

SetRangeBackgroundColor [::Word]

Word, Top

Set the background color of a text range.

SetRangeBackgroundColor rangeId r g b

Parameters
rangeId Identifier of the text range.
r Red component of the text color.
g Green component of the text color.
b Blue component of the text color.
Description

Set the background color of a text range.

The r, g and b values are specified as integers in the range [0, 255].

No return value.

See also: SetRangeBackgroundColorByEnum SetRangeHighlightColorByEnum

SetRangeBackgroundColorByEnum [::Word]

Word, Top

Set the background color of a text range.

SetRangeBackgroundColorByEnum rangeId colorEnum

Parameters
rangeId Identifier of the text range.
colorEnum Value of enumeration type WdColor (see wordConst.tcl).
Description

Set the background color of a text range.

No return value.

See also: SetRangeBackgroundColor SetRangeHighlightColorByEnum

SetRangeEndIndex [::Word]

Word, Top

Set the end index of a text range.

SetRangeEndIndex rangeId index

Parameters
rangeId Identifier of the text range.
index Index for the range end.
Description

Set the end index of a text range.

Index is either an integer value or string "end" to use the end of the document.

No return value.

See also: SetRangeBeginIndex GetRangeEndIndex

SetRangeFontBold [::Word]

Word, Top

Toggle the bold font style of a text range.

SetRangeFontBold rangeId onOff

Parameters
rangeId Identifier of the text range.
onOff(optional, default true) true: Set bold style on. false: Set bold style off.
Description

Toggle the bold font style of a text range.

No return value.

See also: SetRangeFontName SetRangeFontSize SetRangeFontItalic SetRangeFontUnderline

SetRangeFontItalic [::Word]

Word, Top

Toggle the italic font style of a text range.

SetRangeFontItalic rangeId onOff

Parameters
rangeId Identifier of the text range.
onOff(optional, default true) true: Set italic style on. false: Set italic style off.
Description

Toggle the italic font style of a text range.

No return value.

See also: SetRangeFontName SetRangeFontSize SetRangeFontBold SetRangeFontUnderline

SetRangeFontName [::Word]

Word, Top

Set the font name of a text range.

SetRangeFontName rangeId fontName

Parameters
rangeId Identifier of the text range.
fontName Font name.
Description

Set the font name of a text range.

No return value.

See also: SetRangeFontSize SetRangeFontBold SetRangeFontItalic SetRangeFontUnderline

SetRangeFontSize [::Word]

Word, Top

Set the font size of a text range.

SetRangeFontSize rangeId fontSize

Parameters
rangeId Identifier of the text range.
fontSize Font size in points.
Description

Set the font size of a text range.

No return value.

See also: SetRangeFontName SetRangeFontBold SetRangeFontItalic SetRangeFontUnderline

SetRangeFontUnderline [::Word]

Word, Top

Toggle the underline font style of a text range.

SetRangeFontUnderline rangeId onOff color

Parameters
rangeId Identifier of the text range.
onOff(optional, default true) true: Set underline style on. false: Set underline style off.
color(optional, default $::Word::wdColorAutomatic) Value of enumeration type WdColor (see wordConst.tcl)
Description

Toggle the underline font style of a text range.

No return value.

See also: SetRangeFontName SetRangeFontSize SetRangeFontBold SetRangeFontItalic

SetRangeHighlightColorByEnum [::Word]

Word, Top

Set the highlight color of a text range.

SetRangeHighlightColorByEnum rangeId colorEnum

Parameters
rangeId Identifier of the text range.
colorEnum Value of enumeration type WdColor (see wordConst.tcl).
Description

Set the highlight color of a text range.

No return value.

See also: SetRangeBackgroundColorByEnum

SetRangeHorizontalAlignment [::Word]

Word, Top

Set the horizontal alignment of a text range.

SetRangeHorizontalAlignment rangeId align

Parameters
rangeId Identifier of the text range.
align Value of enumeration type WdParagraphAlignment (see wordConst.tcl) or any of the following strings: left, right, center.
Description

Set the horizontal alignment of a text range.

No return value.

See also: SetRangeHighlightColorByEnum

SetRangeStartIndex [::Word]

Word, Top

Set the start index of a text range.

SetRangeStartIndex rangeId index

Parameters
rangeId Identifier of the text range.
index Index for the range start.
Description

Set the start index of a text range.

Index is either an integer value or string "begin" to use the start of the document.

No return value.

See also: SetRangeEndIndex GetRangeStartIndex

SetRangeStyle [::Word]

Word, Top

Set the style of a text range.

SetRangeStyle rangeId style

Parameters
rangeId Identifier of the text range.
style Value of enumeration type WdBuiltinStyle (see wordConst.tcl). Often used values: Word::wdStyleHeading1, Word::wdStyleNormal
Description

Set the style of a text range.

No return value.

See also: SetRangeFontSize SetRangeFontName

SetRowValues [::Word]

Word, Top

Insert row values from a Tcl list.

SetRowValues tableId row valList startCol numVals

Parameters
tableId Identifier of the Word table.
row Row number. Row numbering starts with 1.
valList List of values to be inserted.
startCol(optional, default 1) Column number of insertion start. Column numbering starts with 1.
numVals(optional, default 0) Negative or zero: All list values are inserted. Positive: numVals columns are filled with the list values (starting at list index 0).
Description

Insert row values from a Tcl list.

No return value. If valList is an empty list, an error is thrown.

See also: GetRowValues SetColumnValues SetCellValue

SetTableBorderLineStyle [::Word]

Word, Top

Set the border line styles of a Word table.

SetTableBorderLineStyle tableId outsideLineStyle insideLineStyle

Parameters
tableId Identifier of the Word table.
outsideLineStyle(optional, default -1) Outside border style.
insideLineStyle(optional, default -1) Inside border style.
Description

Set the border line styles of a Word table.

The values of "outsideLineStyle" and "insideLineStyle" must be of enumeration type WdLineStyle (see WordConst.tcl).

See also: AddTable SetTableBorderLineWidth

SetTableBorderLineWidth [::Word]

Word, Top

Set the border line widths of a Word table.

SetTableBorderLineWidth tableId outsideLineWidth insideLineWidth

Parameters
tableId Identifier of the Word table.
outsideLineWidth(optional, default -1) Outside border line width.
insideLineWidth(optional, default -1) Inside border line width.
Description

Set the border line widths of a Word table.

The values of "outsideLineWidth" and "insideLineWidth" must be of enumeration type WdLineWidth (see WordConst.tcl).

See also: AddTable SetTableBorderLineStyle

ToggleSpellCheck [::Word]

Word, Top

Toggle checking of grammatical and spelling errors.

ToggleSpellCheck appId onOff

Parameters
appId Identifier of the Word instance.
onOff
Description

Toggle checking of grammatical and spelling errors.

No return value.

See also:

TrimString [::Word]

Word, Top

Trim a string.

TrimString str

Parameters
str String to be trimmed.
Description

Trim a string.

The string is trimmed from the left and right side. Trimmed characters are: Whitespaces, BEL (0x7) and CR (0xD).

Return the trimmed string.

UpdateFields [::Word]

Word, Top

Update all fields of a document.

UpdateFields docId

Parameters
docId Identifier of the document.
Description

Update all fields of a document.

No return value.

See also: SaveAs

Visible [::Word]

Word, Top

Toggle the visibilty of a Word application window.

Visible appId visible

Parameters
appId Identifier of the Word instance.
visible true: Show the application window. false: Hide the application window.
Description

Toggle the visibilty of a Word application window.

No return value.

See also: Open OpenNew

Document generated by Ruff!