CAWT Reference 2.4.2

::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.
Return value

Returns the corresponding value in points.

Description

Convert centimeter value into points.

See also: SetDotsPerInch InchesToPoints

CheckBoolean [::Cawt]

Cawt, Top

Check, if two boolean values are identical.

CheckBoolean expected value msg printCheck

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

Returns true, if both boolean 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:".

Description

Check, if two boolean values are identical.

See also: CheckComObjects CheckNumber CheckList CheckMatrix CheckString

CheckComObjects [::Cawt]

Cawt, Top

Check, if the number of COM objects fits expected value.

CheckComObjects expected msg printCheck

Parameters
expected Expected number of COM objects.
msg Message for test case.
printCheck(optional, default true) Print message for successful test case.
Return value

Returns true, if the number of COM objects fits expected value. 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:".

Description

Check, if the number of COM objects fits expected value.

See also: CheckList CheckMatrix CheckBoolean CheckNumber CheckString GetNumComObjects

CheckList [::Cawt]

Cawt, Top

Check, if two 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.
Return value

Returns 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:".

Description

Check, if two lists are identical.

See also: CheckComObjects CheckMatrix CheckBoolean CheckNumber CheckString

CheckMatrix [::Cawt]

Cawt, Top

Check, if two 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.
Return value

Returns 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:".

Description

Check, if two matrices are identical.

See also: CheckComObjects CheckList CheckBoolean CheckNumber CheckString

CheckNumber [::Cawt]

Cawt, Top

Check, if two 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.
Return value

Returns 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:".

Description

Check, if two numerical values are identical.

See also: CheckComObjects CheckBoolean CheckList CheckMatrix CheckString

CheckString [::Cawt]

Cawt, Top

Check, if two 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.
Return value

Returns 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:".

Description

Check, if two string values are identical.

See also: CheckComObjects CheckList CheckMatrix CheckBoolean CheckNumber

ClipboardToImg [::Cawt]

Cawt, Top

Copy the clipboard content into a photo image.

ClipboardToImg

Return value

Returns the photo image identifier.

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

ConcatFiles [::Cawt]

Cawt, Top

ConcatFiles outFile args

Parameters
outFile
argsAdditional options.

CountWords [::Cawt]

Cawt, Top

Count words contained in a string.

CountWords str args

Parameters
str String to be searched.
args List of key value pairs specifying the counting configure options and its values.
Return value

Returns a key-value list containing the found words and their corresponding count.

Description

Count words contained in a string.

Option keys:

-sortmode <string>

       Sorting mode of output list.
       Default: length. Possible values: dictionary, length.

-minlength <int>

       Only count words having more than minlength characters.
       Default: No limit.

-maxlength <int>

       Only count words having less than maxlength characters.
       Default: No limit.

-shownumbers <bool>

       If set to false, only count words which are no numbers.

Notes:

      The definition of a word is like in Tcl command "string wordend".
      This procedure can be called as a coroutine. It yields
      every 1000 bytes processed. The yield return value is the
      number of bytes already processed.
      See test script Core-04_String.tcl for an usage example.

See also: ::Word::CountWords

Destroy [::Cawt]

Cawt, Top

Destroy one or all COM objects.

Destroy comObj

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

Returns no value.

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.

See also: PushComObjects PopComObjects

GetColor [::Cawt]

Cawt, Top

Convert a color representation into an Office color number.

GetColor args

Parameters
args A valid color representation.
Description

Convert a color representation into an Office color number.

Colors can be specified in one of the following representations:

      Name: A valid Tcl color name string, ex. "black".
      Hexadecimal: A valid Tcl hexadecimal string, ex. "#00FFAA".
      RGB: 3 integer values in the range 0 .. 255.
      Office number: An integer number with encoded RGB values.

See also: GetColor GetColorNames IsHexColor IsNameColor IsRgbColor IsOfficeColor

GetColorNames [::Cawt]

Cawt, Top

Get all supported Tcl color names.

GetColorNames

Return value

Returns a sorted list of all supported Tcl color names.

Description

Get all supported Tcl color names.

See also: IsNameColor

GetComObjects [::Cawt]

Cawt, Top

Get the COM objects currently in use as a list.

GetComObjects

Return value

Returns the COM objects currently in use as a list.

Description

Get the COM objects currently in use as a list.

See also: IsComObject GetNumComObjects PrintNumComObjects Destroy

GetDotsPerInch [::Cawt]

Cawt, Top

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

GetDotsPerInch

Return value

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

Description

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

See also: SetDotsPerInch

GetNumComObjects [::Cawt]

Cawt, Top

Get the number of COM objects currently in use.

GetNumComObjects

Return value

Returns the number of COM objects currently in use.

Description

Get the number of COM objects currently in use.

See also: IsComObject GetComObjects PrintNumComObjects Destroy

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.
Return value

Returns the application identifier.

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.

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
Return value

Returns the version of the sub-package as a string. If the package is not available (HavePkg == false), an empty string is returned.

Description

Get the version of a Cawt sub-package.

See also: HavePkg

GetProgramByExtension [::Cawt]

Cawt, Top

Get path to program for a given file extension.

GetProgramByExtension extension

Parameters
extension The extension string (including a dot, ex. ".pdf").
Description

Get path to program for a given file extension.

Return the path to the program which is associated in the Windows registry with the file extension.

HavePkg [::Cawt]

Cawt, Top

Check, if a Cawt sub-package is available.

HavePkg pkgName

Parameters
pkgName The name of the sub-package.
Return value

Returns true, if sub-package pkgName was loaded successfully. Otherwise returns false.

Description

Check, if a Cawt sub-package is available.

See also: GetPkgVersion

ImgToClipboard [::Cawt]

Cawt, Top

Copy a photo image into the clipboard.

ImgToClipboard phImg

Parameters
phImg The photo image identifier.
Return value

Returns no value.

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.
Return value

Returns the corresponding value in points.

Description

Convert inch value into points.

See also: SetDotsPerInch CentiMetersToPoints

IsComObject [::Cawt]

Cawt, Top

Check, if a COM object is valid.

IsComObject comObj

Parameters
comObj The COM object.
Return value

Returns true, if comObj is a valid object. Otherwise returns false.

Description

Check, if a COM object is valid.

See also: GetComObjects GetNumComObjects PrintNumComObjects

IsHexColor [::Cawt]

Cawt, Top

Check, if specified color is a valid Tcl hexadecimal color string.

IsHexColor color

Parameters
color The Tcl color string as hexadecimal representation, ex. "#0ACCF0".
Return value

Returns true, if supplied string is a valid color string, otherwise false.

Description

Check, if specified color is a valid Tcl hexadecimal color string.

See also: GetColor GetColorNames IsNameColor IsRgbColor IsOfficeColor

IsNameColor [::Cawt]

Cawt, Top

Check, if specified color is a valid Tcl color name.

IsNameColor color

Parameters
color The Tcl color name as a string, ex. "black".
Return value

Returns true, if supplied string is a valid color name, otherwise false.

Description

Check, if specified color is a valid Tcl color name.

See also: GetColor GetColorNames IsHexColor IsRgbColor IsOfficeColor

IsoDateToOutlookDate [::Cawt]

Cawt, Top

Return ISO date string as Outlook date.

IsoDateToOutlookDate isoDate

Parameters
isoDate Date string in format %Y-%m-%d %H:%M:%S
Description

Return ISO date string as Outlook date.

Return corresponding date as floating point number representing days since 1900/01/01.

See also: OutlookDateToIsoDate IsoDateToSeconds IsoDateToXmlDate

IsoDateToSeconds [::Cawt]

Cawt, Top

Return ISO date string as seconds.

IsoDateToSeconds isoDate

Parameters
isoDate Date string in format %Y-%m-%d %H:%M:%S
Description

Return ISO date string as seconds.

Return corresponding seconds as integer.

See also: SecondsToIsoDate XmlDateToSeconds OutlookDateToSeconds

IsoDateToXmlDate [::Cawt]

Cawt, Top

Return ISO date string as XML date string.

IsoDateToXmlDate isoDate

Parameters
isoDate Date string in format %Y-%m-%d %H:%M:%S
Description

Return ISO date string as XML date string.

Return corresponding date as XML date string.

See also: XmlDateToIsoDate IsoDateToSeconds IsoDateToOutlookDate

IsOfficeColor [::Cawt]

Cawt, Top

Check, if specified color is a valid Office color number.

IsOfficeColor color

Parameters
color The Office color number.
Return value

Returns true, if supplied string is a valid color string, otherwise false.

Description

Check, if specified color is a valid Office color number.

See also: GetColor GetColorNames IsHexColor IsNameColor IsRgbColor

IsRgbColor [::Cawt]

Cawt, Top

Check, if specified color is a valid RGB representation.

IsRgbColor 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
Return value

Returns true, if supplied values are in the supported range, otherwise false.

Description

Check, if specified color is a valid RGB representation.

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

See also: GetColor GetColorNames IsHexColor IsNameColor IsOfficeColor

IsUnicodeFile [::Cawt]

Cawt, Top

Check, if a file is encode in Unicode.

IsUnicodeFile fileName

Parameters
fileName File to check encoding.
Return value

Returns true, if file is encode in Unicode, otherwise false.

Description

Check, if a file is encode in Unicode.

Unicode encoding is detected by checking the BOM. If the first two bytes are FF FE, the file seems to be a Unicode file.

See also:

IsValidId [::Cawt]

Cawt, Top

Obsolete: Replaced with IsComObject in version 2.0.0

IsValidId comObj

Parameters
comObj
Description

Obsolete: Replaced with IsComObject in version 2.0.0

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.
Return value

Returns no value.

Description

Kill all running instances of an application.

See also: GetOrCreateApp

OfficeColorToRgb [::Cawt]

Cawt, Top

Convert an Office color number into a RGB color list.

OfficeColorToRgb color

Parameters
color The Office color number
Return value

Returns the color as a list of r, b and b values. The r, g and b values are returned as integers in the range 0 .. 255.

Description

Convert an Office color number into a RGB color list.

See also: RgbToOfficeColor GetColor

OutlookDateToIsoDate [::Cawt]

Cawt, Top

Return Outlook date as ISO date string.

OutlookDateToIsoDate outlookDate

Parameters
outlookDate Floating point number representing days since 1900/01/01.
Description

Return Outlook date as ISO date string.

Return corresponding date as ISO date string.

See also: IsoDateToOutlookDate OutlookDateToSeconds

OutlookDateToSeconds [::Cawt]

Cawt, Top

Return Outlook date as seconds.

OutlookDateToSeconds outlookDate

Parameters
outlookDate Floating point number representing days since 1900/01/01.
Description

Return Outlook date as seconds.

Return corresponding seconds as integer.

See also: SecondsToOutlookDate IsoDateToSeconds XmlDateToSeconds

PointsToCentiMeters [::Cawt]

Cawt, Top

Convert value in points into centimeters.

PointsToCentiMeters points

Parameters
points Floating point value to be converted to centimeters.
Return value

Returns the corresponding value in centimeters.

Description

Convert value in points into centimeters.

See also: SetDotsPerInch InchesToPoints CentiMetersToPoints

PointsToInches [::Cawt]

Cawt, Top

Convert value in points into inches.

PointsToInches points

Parameters
points Floating point value to be converted to inches.
Return value

Returns the corresponding value in inches.

Description

Convert value in points into inches.

See also: SetDotsPerInch CentiMetersToPoints InchesToPoints

PopComObjects [::Cawt]

Cawt, Top

Pop last entry from COM objects stack.

PopComObjects printStack

Parameters
printStack(optional, default false) Print stack content after popping onto stdout.
Return value

Returns no value.

Description

Pop last entry from COM objects stack.

Pop last entry from COM objects stack and remove all COM objects currently in use which are not contained in the popped entry.

See also: PushComObjects

PrintNumComObjects [::Cawt]

Cawt, Top

Print the number of currently available COM objects to stdout.

PrintNumComObjects

Return value

Returns no value.

Description

Print the number of currently available COM objects to stdout.

See also: IsComObject GetComObjects GetNumComObjects Destroy

PushComObjects [::Cawt]

Cawt, Top

Push current list of COM objects onto a stack.

PushComObjects printStack

Parameters
printStack(optional, default false) Print stack content after pushing onto stdout.
Return value

Returns no value.

Description

Push current list of COM objects onto a stack.

See also: PopComObjects

RgbToOfficeColor [::Cawt]

Cawt, Top

Convert a RGB color into an Office color number.

RgbToOfficeColor 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
Return value

Returns the color as an Office color integer number.

Description

Convert a RGB color into an Office color number.

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

See also: OfficeColorToRgb GetColor

SecondsToIsoDate [::Cawt]

Cawt, Top

Return date in seconds as ISO date string.

SecondsToIsoDate sec

Parameters
sec Date in seconds (as returned by clock seconds).
Description

Return date in seconds as ISO date string.

Return corresponding date as ISO date string.

See also: IsoDateToSeconds SecondsToXmlDate SecondsToOutlookDate

SecondsToOutlookDate [::Cawt]

Cawt, Top

Return date in seconds as Outlook date.

SecondsToOutlookDate sec

Parameters
sec Date in seconds (as returned by clock seconds).
Description

Return date in seconds as Outlook date.

Return corresponding date as floating point number representing days since 1900/01/01.

See also: OutlookDateToSeconds SecondsToIsoDate SecondsToXmlDate

SecondsToXmlDate [::Cawt]

Cawt, Top

Return date in seconds as XML date string.

SecondsToXmlDate sec

Parameters
sec Date in seconds (as returned by clock seconds).
Description

Return date in seconds as XML date string.

Return corresponding date as XML date string.

See also: XmlDateToSeconds SecondsToIsoDate SecondsToOutlookDate

SetDotsPerInch [::Cawt]

Cawt, Top

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

SetDotsPerInch dpi

Parameters
dpi Integer dpi value.
Return value

Returns no 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.

See also: GetDotsPerInch

SplitFile [::Cawt]

Cawt, Top

SplitFile inFile maxFileSize outFilePrefix

Parameters
inFile
maxFileSize(optional, default 2048)
outFilePrefix(optional, default )

TclBool [::Cawt]

Cawt, Top

Cast a value to a boolean.

TclBool val

Parameters
val The value to be casted.
Return value

Returns true, if val is not equal to zero or true. Otherwise returns false.

Description

Cast a value to a boolean.

See also: TclInt TclString

TclInt [::Cawt]

Cawt, Top

Cast a value to an integer with boolean range.

TclInt val

Parameters
val The value to be casted.
Return value

Returns 1, if val is not equal to zero or true. Otherwise returns 0.

Description

Cast a value to an integer with boolean range.

See also: TclBool TclString

TclString [::Cawt]

Cawt, Top

Cast a value to a string.

TclString val

Parameters
val The value to be casted.
Return value

Returns casted string in a format usable for the COM interface.

Description

Cast a value to a string.

See also: TclInt TclBool

ValueToPoints [::Cawt]

Cawt, Top

Convert a value into points.

ValueToPoints value

Parameters
value Floating point value to be converted to points.
Return value

Returns the corresponding value in points.

Description

Convert a value into points.

  • If the value is followed by "i", it is interpreted as inches.
  • If the value is followed by "c", it is interpreted as centimeters.
  • If the value is a simple floating point number or followed by "p", it is interpreted as points, i.e. the pure value is returned.

Example:

     ValueToPoints 2c
     ValueToPoints 1.5i

See also: CentiMetersToPoints InchesToPoints

XmlDateToIsoDate [::Cawt]

Cawt, Top

Return XML date string as ISO date string.

XmlDateToIsoDate xmlDate

Parameters
xmlDate Date string in format %Y-%m-%dT%H:%M:%S.000Z
Description

Return XML date string as ISO date string.

Return corresponding date as ISO date string.

See also: IsoDateToXmlDate XmlDateToSeconds

XmlDateToSeconds [::Cawt]

Cawt, Top

Return XML date string as seconds.

XmlDateToSeconds xmlDate

Parameters
xmlDate Date string in format %Y-%m-%dT%H:%M:%S.000Z
Description

Return XML date string as seconds.

Return corresponding seconds as integer.

See also: SecondsToXmlDate IsoDateToSeconds OutlookDateToSeconds

::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 instance, if available.

Open

Description

Open a GoogleEarth instance. Use an already running instance, 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 instance.

Quit appId

Parameters
appId Identifier of the GoogleEarth instance.
Description

Quit a GoogleEarth 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).

markerSize must be between 2 and 72.

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 one worksheet.

AddWorkbook appId type

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

Add a new workbook with one 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 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 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:

    [Excel ColumnCharToInt A] returns 1.
    [Excel ColumnCharToInt Z] returns 26.

See also: GetColumnNumber 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:

    [Excel ColumnIntToChar 1]  returns "A".
    [Excel ColumnIntToChar 26] returns "Z".

See also: ColumnCharToInt

CopyColumn [::Excel]

Excel, Top

Copy the contents of a column into another column.

CopyColumn fromWorksheetId fromCol toWorksheetId toCol fromRow toRow pasteType

Parameters
fromWorksheetId Identifier of the source worksheet.
fromCol Source column number. Column numbering starts with 1.
toWorksheetId Identifier of the destination worksheet.
toCol Destination column number. Column numbering starts with 1.
fromRow(optional, default 1) Start row of source column.
toRow(optional, default 1) Start row of destination column.
pasteType(optional, default xlPasteAll) Value of enumeration type XlPasteType (see excelConst.tcl). Typical values are: xlPasteAll, xlPasteAllExceptBorders, xlPasteValues.
Return value

Returns no value.

Description

Copy the contents of a column into another column.

Note, that the contents of the destination column are overwritten.

See also: CopyRange CopyWorksheet

CopyRange [::Excel]

Excel, Top

Copy the contents of a cell range into another cell range.

CopyRange fromRangeId toRangeId pasteType

Parameters
fromRangeId Identifier of the source range.
toRangeId Identifier of the destination range.
pasteType(optional, default xlPasteAll) Value of enumeration type XlPasteType (see excelConst.tcl). Typical values are: xlPasteAll, xlPasteAllExceptBorders, xlPasteValues.
Return value

Returns no value.

Description

Copy the contents of a cell range into another cell range.

Note, that the contents of the destination range are overwritten.

See also: SelectAll CopyWorksheet CopyColumn

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

CreateRangeString [::Excel]

Excel, Top

Create a range string in A1 notation.

CreateRangeString args

Parameters
args List of quadruples specifying cell ranges.
Description

Create a range string in A1 notation.

The first two elements of each quadruple represent the row and column indices of the top-left cell of each range. The last two elements of each quadruple represent the row and column indices of the bottom-right cell of the range.

Example: CreateRangeString 1 1 2 3 4 2 6 3 returns "A1:C2;B4:C6"

Return range string in A1 notation.

See also: SelectRangeByIndex SelectRangeByString

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

DeleteColumn [::Excel]

Excel, Top

Delete a column.

DeleteColumn worksheetId col

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

Delete a column.

The specified column is deleted.

No return value.

See also: InsertColumn DuplicateColumn HideColumn DeleteRow DeleteWorksheet

DeleteRow [::Excel]

Excel, Top

Delete a row.

DeleteRow worksheetId row

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

Delete a row.

The specified row is deleted.

No return value.

See also: InsertRow DuplicateRow HideRow DeleteColumn DeleteWorksheet

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.

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

No return value.

See also: DeleteWorksheetByIndex GetWorksheetIdByIndex AddWorksheet

DeleteWorksheetByIndex [::Excel]

Excel, Top

Delete a worksheet identified by its 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 its 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 two Excel files visually.

DiffExcelFiles excelBaseFile excelNewFile args

Parameters
excelBaseFile Name of the base Excel file.
excelNewFile Name of the new Excel file.
args Mark color.
Return value

Returns the identifier of the new Excel application instance.

Description

Compare two 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.

Color value may be specified in a format acceptable by procedure ::Cawt::GetColor, i.e. color name, hexadecimal string, Office color number or a list of 3 integer RGB values. If no mark color is specified, it is set to red.

See also: OpenNew ::Cawt::GetColor

DuplicateColumn [::Excel]

Excel, Top

Duplicate a column.

DuplicateColumn worksheetId col

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

Duplicate a column.

The specified column is duplicated with formatting and formulas.

No return value.

See also: InsertColumn DeleteColumn HideColumn DuplicateRow

DuplicateRow [::Excel]

Excel, Top

Duplicate a row.

DuplicateRow worksheetId row

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

Duplicate a row.

The specified row is duplicated with formatting and formulas.

No return value.

See also: InsertRow DeleteRow HideRow DuplicateColumn

ExcelFileToHtmlFile [::Excel]

Excel, Top

Convert an Excel file to a HTML table file.

ExcelFileToHtmlFile excelFileName htmlFileName args

Parameters
excelFileName Name of the Excel input file.
htmlFileName Name of the HTML output file.
args List of key value pairs specifying options and its values.
Description

Convert an Excel file to a HTML table file.

Option keys: -worksheet

      Set the worksheet name or index to convert.
      Default value: 0

-quit

      true: Quit the Excel instance after generation of output file.
      false: Leave the Excel instance open after generation of output file.
      Default value: true

-target

      true: Generate a target attribute for hyperlinks.
      false: No target attribute for hyperlinks, i.e. link opens in same tab.
      Default value: true

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

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

See also: WorksheetToHtmlFile WriteHtmlFile MediaWikiFileToExcelFile WikitFileToExcelFile

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 pixelType

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.
pixelType(optional, default float) Pixel type (byte, short, float).
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 its 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 its 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

GetCellComment [::Excel]

Excel, Top

Return the comment text of a cell.

GetCellComment 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 the comment text of a cell.

If the cell does not contain a comment, an empty string is returned.

See also: SetRangeComment SetCommentDisplayMode SetCommentSize GetCellValue

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 in A1 notation.

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 in A1 notation.

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

GetChartNumSeries [::Excel]

Excel, Top

Return the number of series of a chart.

GetChartNumSeries chartId

Parameters
chartId Identifier of the chart.
Description

Return the number of series of a chart.

See also: GetChartSeries CreateChart

GetChartSeries [::Excel]

Excel, Top

Get a specific series of a chart.

GetChartSeries chartId index

Parameters
chartId Identifier of the chart.
index Index of the series. Index numbering starts with 1.
Description

Get a specific series of a chart.

Return the series identifier.

See also: GetChartNumSeries CreateChart SetSeriesLineWidth

GetColumnNumber [::Excel]

Excel, Top

Return an Excel column string or number as a column number.

GetColumnNumber colStrOrInt

Parameters
colStrOrInt Column string.
Description

Return an Excel column string or number as a column number.

See also: 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.

GetCurrencyFormat [::Excel]

Excel, Top

Return an Excel number format string for currencies.

GetCurrencyFormat appId currency pre post floatSep

Parameters
appId Identifier of the Excel instance.
currency String identifying the currency symbol.
pre(optional, default 0) Number of digits before the decimal point.
post(optional, default 00) Number of digits after the decimal point.
floatSep(optional, default ) Specify the floating point separator character.
Description

Return an Excel number format string for currencies.

The currency may be specified either by using one of the predefined names (Dollar, Euro, Pound, Yen, DM) or by specifying an Unicode character.

Example:

     [GetCurrencyFormat "\u20B0" "0" "00"] will return the Excel format string
     to show floating point values with 2 digits after the decimal point
     and a German Penny Sign as currency symbol.

See also: SetRangeFormat GetNumberFormat

GetDecimalSeparator [::Excel]

Excel, Top

Return the decimal separator used by Excel.

GetDecimalSeparator appId

Parameters
appId Identifier of the Excel instance.
Description

Return the decimal separator used by Excel.

See also: GetVersion GetThousandsSeparator

GetEnum [::Excel]

Excel, Top

Get numeric value of an enumeration.

GetEnum enumOrString

Parameters
enumOrString Enumeration name
Return value

Returns the numeric value of an enumeration.

Description

Get numeric value of an enumeration.

See also: GetEnumName GetEnumTypes GetEnumVal GetEnumNames

GetEnumName [::Excel]

Excel, Top

Get name of a given enumeration type and numeric value.

GetEnumName enumType enumVal

Parameters
enumType Enumeration type
enumVal Enumeration numeric value.
Return value

Returns a list of names of a given enumeration type.

Description

Get name of a given enumeration type and numeric value.

See also: GetEnumNames GetEnumTypes GetEnumVal GetEnum

GetEnumNames [::Excel]

Excel, Top

Get names of a given enumeration type.

GetEnumNames enumType

Parameters
enumType Enumeration type
Return value

Returns a list of names of a given enumeration type.

Description

Get names of a given enumeration type.

See also: GetEnumName GetEnumTypes GetEnumVal GetEnum

GetEnumTypes [::Excel]

Excel, Top

Get available enumeration types.

GetEnumTypes

Return value

Returns a list of available enumeration types.

Description

Get available enumeration types.

See also: GetEnumName GetEnumNames GetEnumVal GetEnum

GetEnumVal [::Excel]

Excel, Top

Get numeric value of an enumeration name.

GetEnumVal enumName

Parameters
enumName Enumeration name
Return value

Returns the numeric value of an enumeration name.

Description

Get numeric value of an enumeration name.

See also: GetEnumName GetEnumTypes GetEnumNames GetEnum

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

Obsolete: Replaced with GetDecimalSeparator in version 2.1.0

GetFloatSeparator

Description

Obsolete: Replaced with GetDecimalSeparator in version 2.1.0

Return the decimal separator used by Excel.

Only valid, after a call of Open or OpenNew. Note, that this procedure has been superseeded with GetDecimalSeparator in version 2.1.0. Only use it, if using an Excel version older than 2007.

See also: GetVersion GetDecimalSeparator GetThousandsSeparator

GetHiddenColumns [::Excel]

Excel, Top

Return the hidden columns of a worksheet.

GetHiddenColumns worksheetId

Parameters
worksheetId Identifier of the worksheet.
Description

Return the hidden columns of a worksheet.

Return the hidden columns as a list of column numbers. If no columns are hidden, an empty list is returned. Column numbering starts with 1.

See also: HideColumn GetHiddenRows ColumnCharToInt

GetHiddenRows [::Excel]

Excel, Top

Return the hidden rows of a worksheet.

GetHiddenRows worksheetId

Parameters
worksheetId Identifier of the worksheet.
Description

Return the hidden rows of a worksheet.

Return the hidden rows as a list of row numbers. If no rows are hidden, an empty list is returned. Row numbering starts with 1.

See also: HideRow GetHiddenColumns ColumnCharToInt

GetLangNumberFormat [::Excel]

Excel, Top

Obsolete: Replaced with GetNumberFormat in version 2.1.0

GetLangNumberFormat pre post floatSep

Parameters
pre
post
floatSep(optional, default )
Description

Obsolete: Replaced with GetNumberFormat in version 2.1.0

Return an Excel number format string.

pre Number of digits before the decimal point.
post Number of digits after the decimal point.
floatSep Specify the floating point separator character.

The number of digits is specified as a string containing as many zeros as wanted digits. If no floating point separator is specified or the empty string, the floating point separator of Excel is used.

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

GetNamedRange [::Excel]

Excel, Top

Get the identifier of a named range.

GetNamedRange objId rangeName

Parameters
objId Identifier of a workbook or worksheet.
rangeName Name of range to get.
Description

Get the identifier of a named range.

Return the range identifier of the named range.

See also: SelectRangeByIndex GetNamedRangeNames SetNamedRange

GetNamedRangeNames [::Excel]

Excel, Top

Get the names of named ranges.

GetNamedRangeNames objId

Parameters
objId Identifier of a workbook or worksheet.
Return value

Returns a sorted list of all names.

Description

Get the names of named ranges.

See also: GetNamedRange SetNamedRange

GetNumberFormat [::Excel]

Excel, Top

Return an Excel number format string.

GetNumberFormat appId pre post floatSep

Parameters
appId Identifier of the Excel instance.
pre Number of digits before the decimal point.
post Number of digits after the decimal point.
floatSep(optional, default ) Specify the floating point separator character.
Description

Return an Excel number format string.

The number of digits is specified as a string containing as many zeros as wanted digits. If no floating point separator is specified or the empty string, the floating point separator of Excel is used.

Example:

    [GetNumberFormat "0" "0000"] will return the Excel format string
    to show floating point values with 4 digits after the decimal point.

See also: SetRangeFormat GetCurrencyFormat

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.

Note, that this procedure returns 1, even if the worksheet is empty. Use IsWorksheetEmpty to determine, if a worksheet is totally empty.

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.

Note, that this procedure returns 1, even if the worksheet is empty. Use IsWorksheetEmpty to determine, if a worksheet is totally empty.

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

GetRangeAsIndex [::Excel]

Excel, Top

Get address of a cell range as list of row/column indices.

GetRangeAsIndex rangeId

Parameters
rangeId Identifier of the cell range.
Description

Get address of a cell range as list of row/column indices.

Return address of a cell range as a 2 or 4 element list of integers:

If the range represents a single cell, the list consists of 2 elements, representing the row and column index of the cell.

If the range represents more than one cell, the list consists of 4 elements. The first two elements represent the row and column indices of the top-left cell of the range. The last two elements represent the row and column indices of the bottom-right cell of the range.

See also: SelectRangeByIndex GetCellRange

GetRangeAsString [::Excel]

Excel, Top

Get address of a cell range as Excel range string in A1 notation.

GetRangeAsString rangeId

Parameters
rangeId Identifier of the cell range.
Description

Get address of a cell range as Excel range string in A1 notation.

Return address of a cell range as Excel range string in A1 notation.

See also: SelectRangeByString GetCellRange

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.
Return value

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

Description

Get the fill color of a cell range.

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

See also: SetRangeFillColor ::Cawt::OfficeColorToRgb SelectRangeByIndex SelectRangeByString

GetRangeFontBold [::Excel]

Excel, Top

Get the bold font style of a cell range.

GetRangeFontBold rangeId

Parameters
rangeId Identifier of the cell range.
Description

Get the bold font style of a cell range.

Return true, if the font in specified cell range has the bold flag set.

See also: SetRangeFontBold SelectRangeByIndex

GetRangeFontItalic [::Excel]

Excel, Top

Get the italic font style of a cell range.

GetRangeFontItalic rangeId

Parameters
rangeId Identifier of the cell range.
Description

Get the italic font style of a cell range.

Return true, if the font in specified cell range has the italic flag set.

See also: SetRangeFontItalic SelectRangeByIndex

GetRangeFontName [::Excel]

Excel, Top

Get the font name of a cell or character range.

GetRangeFontName rangeId

Parameters
rangeId Identifier of the cell range.
Description

Get the font name of a cell or character range.

Return the font name in specified cell range as a string.

See also: SetRangeFontName SelectRangeByIndex

GetRangeFontSize [::Excel]

Excel, Top

Get the font size of a cell range.

GetRangeFontSize rangeId

Parameters
rangeId Identifier of the cell range.
Description

Get the font size of a cell range.

Return the size of the font in specified cell range measured in points.

See also: SetRangeFontSize SelectRangeByIndex

GetRangeFontSubscript [::Excel]

Excel, Top

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

GetRangeFontSubscript rangeId

Parameters
rangeId Identifier of the cell range.
Description

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

Return true, if the font in specified cell range has the subscript flag set.

See also: SetRangeFontSubscript SelectRangeByIndex

GetRangeFontSuperscript [::Excel]

Excel, Top

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

GetRangeFontSuperscript rangeId

Parameters
rangeId Identifier of the cell range.
Description

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

Return true, if the font in specified cell range has the superscript flag set.

See also: SetRangeFontSuperscript SelectRangeByIndex GetRangeCharacters

GetRangeFontUnderline [::Excel]

Excel, Top

Get the underline font style of a cell range.

GetRangeFontUnderline rangeId

Parameters
rangeId Identifier of the cell range.
Description

Get the underline font style of a cell range.

Return the underline style of specified cell range. The returned value is of enumeration type XlUnderlineStyle (see excelConst.tcl).

See also: SetRangeFontUnderline SelectRangeByIndex

GetRangeFormat [::Excel]

Excel, Top

Get the number format of a cell range.

GetRangeFormat rangeId

Parameters
rangeId Identifier of the cell range.
Return value

Returns the number format in Excel style.

Description

Get the number format of a cell range.

See also: SetRangeFormat SelectRangeByIndex SelectRangeByString

GetRangeHorizontalAlignment [::Excel]

Excel, Top

Get the horizontal alignment of a cell range.

GetRangeHorizontalAlignment rangeId

Parameters
rangeId Identifier of the cell range.
Description

Get the horizontal alignment of a cell range.

Return the horizontal alignment as a value of enumeration type XlHAlign (see excelConst.tcl).

See also: SetRangeHorizontalAlignment SelectRangeByIndex SelectRangeByString

GetRangeTextColor [::Excel]

Excel, Top

Get the text color of a cell range.

GetRangeTextColor rangeId

Parameters
rangeId Identifier of the cell range.
Description

Get the text color of a cell range.

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

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

See also: SetRangeTextColor ::Cawt::OfficeColorToRgb SelectRangeByIndex SelectRangeByString

GetRangeValues [::Excel]

Excel, Top

Return range values as a matrix.

GetRangeValues rangeId

Parameters
rangeId Identifier of the cell range.
Description

Return range values as a matrix.

See also: SetRangeValues GetMatrixValues GetRowValues GetColumnValues GetCellValue

GetRangeVerticalAlignment [::Excel]

Excel, Top

Get the vertical alignment of a cell range.

GetRangeVerticalAlignment rangeId

Parameters
rangeId Identifier of the cell range.
Description

Get the vertical alignment of a cell range.

Return the vertical alignment as a value of enumeration type XlVAlign (see excelConst.tcl).

See also: SetRangeVerticalAlignment SelectRangeByIndex SelectRangeByString

GetRangeWrapText [::Excel]

Excel, Top

Get the wrap text mode of a cell range.

GetRangeWrapText rangeId

Parameters
rangeId Identifier of the cell range.
Description

Get the wrap text mode of a cell range.

Return true, if the specified cell range has the wrap text flag set.

See also: SetRangeWrapText GetRangeHorizontalAlignment GetRangeTextColor SelectRangeByIndex

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

GetThousandsSeparator [::Excel]

Excel, Top

Return the thousands separator used by Excel.

GetThousandsSeparator appId

Parameters
appId Identifier of the Excel instance.
Description

Return the thousands separator used by Excel.

See also: GetVersion GetDecimalSeparator

GetVersion [::Excel]

Excel, Top

Return the version of an Excel application.

GetVersion objId useString

Parameters
objId Identifier of an Excel object 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: GetDecimalSeparator GetExtString

GetWorkbookIdByName [::Excel]

Excel, Top

Find an open workbook by its name.

GetWorkbookIdByName appId workbookName

Parameters
appId Identifier of the Excel instance.
workbookName Name of the workbook to find.
Description

Find an open workbook by its name.

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

See also: OpenWorkbook GetActiveWorkbook GetWorkbookName GetWorksheetIdByName

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 its 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 its 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 its 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 its 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 GetWorkbookIdByName

GetWorksheetIndexByName [::Excel]

Excel, Top

Find a worksheet index by its 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 its 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

HideColumn [::Excel]

Excel, Top

Hide or unhide a column.

HideColumn worksheetId col hide

Parameters
worksheetId Identifier of the worksheet.
col Column number. Column numbering starts with 1.
hide(optional, default true) If set to true, the specified column is hidden, otherwise it is shown.
Description

Hide or unhide a column.

No return value.

See also: InsertColumn DeleteColumn DuplicateColumn GetHiddenColumns HideRow

HideRow [::Excel]

Excel, Top

Hide or unhide a row.

HideRow worksheetId row hide

Parameters
worksheetId Identifier of the worksheet.
row Row number. Row numbering starts with 1.
hide(optional, default true) If set to true, the specified row is hidden, otherwise it is shown.
Description

Hide or unhide a row.

No return value.

See also: InsertRow DeleteRow DuplicateRow GetHiddenRows HideColumn

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.
colWidth(optional, default 1) Column width in average-size characters of the widget's font.
Description

Put a photo image into a worksheet.

The height value may be specified in a format acceptable by procedure ::Cawt::ValueToPoints, i.e. centimeters, inches or points.

Note: Use only with small images.

No return value.

See also: WorksheetToImg UseImgTransparency ::Cawt::ValueToPoints ::Cawt::ImgToClipboard RawImageFileToWorksheet SetRowHeight SetColumnWidth

Import [::Excel]

Excel, Top

Import data from an external data source.

Import rangeId fileName args

Parameters
rangeId Identifier of the cell range.
fileName File name of the data source.
args List of key value pairs specifying import configure options and its values.
Return value

Returns no value.

Description

Import data from an external data source.

Option keys:

-delimiter

   Delimiter character. Possible values: "\t" " " ";" ","

-decimalseparator

   Decimal separator character.

-thousandsseparator

   Thousands separator character.

See also: OpenWorkbook SaveAsCsv

InsertColumn [::Excel]

Excel, Top

Insert a new empty column.

InsertColumn worksheetId col

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

Insert a new empty column.

A new empty column is inserted at given column number.

No return value.

See also: DeleteColumn DuplicateColumn HideColumn InsertRow

InsertImage [::Excel]

Excel, Top

Insert an image into a worksheet.

InsertImage worksheetId imgFileName row col linkToFile saveWithDoc

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.
linkToFile(optional, default false) Insert a link to the image file.
saveWithDoc(optional, default true) Embed the image into the document.
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.

If both linkToFile and saveWithDoc are set to false, an error is thrown.

Return the identifier of the inserted image as a shape.

See also: ScaleImage

InsertRow [::Excel]

Excel, Top

Insert a new empty row.

InsertRow worksheetId row

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

Insert a new empty row.

A new empty row is inserted at given row number.

No return value.

See also: DeleteRow DuplicateRow HideRow InsertColumn

IsWorkbookId [::Excel]

Excel, Top

Check, if Excel object is a workbook identifier.

IsWorkbookId objId

Parameters
objId The identifier of an Excel object.
Description

Check, if Excel object is a workbook identifier.

Return true, if objId is a valid Excel workbook identifier. Otherwise return false.

See also: ::Cawt::IsComObject ::Office::GetApplicationId

IsWorkbookOpen [::Excel]

Excel, Top

Check, if a workbook is open.

IsWorkbookOpen appId workbookName

Parameters
appId Identifier of the Excel instance.
workbookName Name of the workbook to find.
Description

Check, if a workbook is open.

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

See also: OpenWorkbook IsWorkbookProtected

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 IsWorkbookOpen

IsWorksheetEmpty [::Excel]

Excel, Top

Check, if a worksheet is empty.

IsWorksheetEmpty worksheetId

Parameters
worksheetId Identifier of the worksheet to be checked.
Description

Check, if a worksheet is empty.

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

See also: GetNumUsedRows GetNumUsedColumns GetFirstUsedRow GetLastUsedRow

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: WorksheetToMatlabFile 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 instance, 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 instance, 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 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 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 CSV 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 fmt

Parameters
workbookId Identifier of the workbook containing the worksheet.
worksheetId Identifier of the worksheet to save.
fileName Name of the CSV file.
fmt(optional, default xlCSV) Value of enumeration type XlFileFormat (see excelConst.tcl). If not given, the file is stored in xlCSV format.
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 shapeId scaleWidth scaleHeight

Parameters
shapeId Identifier of the image shape.
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 its 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 its 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 in A1 notation.

SelectRangeByString worksheetId rangeStr visSel

Parameters
worksheetId Identifier of the worksheet.
rangeStr String specifying a cell range, ex. "A8:C10".
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 in A1 notation.

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".

No return value.

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

SetChartSourceByIndex [::Excel]

Excel, Top

Set the cell range for the source of a chart.

SetChartSourceByIndex chartId worksheetId row1 col1 row2 col2 type

Parameters
chartId Identifier of the chart.
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.
type(optional, default xlColumns) Value of enumeration type XlRowCol (see excelConst.tcl).
Description

Set the cell range for the source of a chart.

No return value.

See also: CreateChart SetChartTitle SetChartScale

SetChartTicks [::Excel]

Excel, Top

Set the tick spacing of an axis of a chart.

SetChartTicks chartId axisName tickMarkSpacing tickLabelSpacing

Parameters
chartId Identifier of the chart.
axisName Name of axis. Possible values: "x" or "y".
tickMarkSpacing(optional, default ) Spacing of tick marks.
tickLabelSpacing(optional, default ) Spacing of tick labels.
Description

Set the tick spacing of an axis of a chart.

If spacing values are not specified or the emtpy string, the corresponding spacing uses the default values, which are automatically determined by Excel.

No return value.

See also: SetChartMaxScale SetChartScale SetChartObjSize

SetChartTitle [::Excel]

Excel, Top

Set the title of a chart.

SetChartTitle chartId title

Parameters
chartId Identifier of the chart.
title Name of the chart title.
Description

Set the title of a chart.

No return value.

See also: SetChartMinScale SetChartScale CreateChart

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 GetCellComment

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 may be specified in a format acceptable by procedure Cawt::ValueToPoints, i.e. centimeters, inches or points.

No return value.

See also: SetRangeComment SetCommentDisplayMode GetCellComment ::Cawt::ValueToPoints

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 Path name of the linked file.
textDisplay(optional, default ) Text to be displayed instead of the file name.
Return value

Returns no value.

Description

Insert a hyperlink to a file into a cell.

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.
Return value

Returns no value.

Description

Insert an internal link to a cell into another cell.

Note, that the number format of the source cell is used as number format of the destination cell.

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

SetNamedRange [::Excel]

Excel, Top

Set the name of a cell range.

SetNamedRange rangeId rangeName useWorksheet

Parameters
rangeId Identifier of the cell range.
rangeName Name of the cell range. Must not contain spaces.
useWorksheet(optional, default true) If true, set the name at the worksheet level. Otherwise set it at the workbook level.
Description

Set the name of a cell range.

No return value.

See also: GetNamedRange GetNamedRangeNames

SetRangeBorder [::Excel]

Excel, Top

Set the attributes of one border of a cell range.

SetRangeBorder rangeId side weight lineStyle args

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 xlThin) Value of enumeration type XlBorderWeight (see excelConst.tcl). Typical values: xlThin, xlMedium, xlThick.
lineStyle(optional, default xlContinuous) Value of enumeration type XlLineStyle (see excelConst.tcl). Typical values: xlContinuous, xlDash, xlDot.
args Border color.
Return value

Returns no value.

Description

Set the attributes of one border of a cell range.

Color value may be specified in a format acceptable by procedure ::Cawt::GetColor, i.e. color name, hexadecimal string, Office color number or a list of 3 integer RGB values. If no border color is specified, it is set to black.

See also: SetRangeBorders SelectRangeByIndex SelectRangeByString ::Cawt::GetColor

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 xlThin) Value of enumeration type XlBorderWeight (see excelConst.tcl). Typical values: xlThin, xlMedium, xlThick.
lineStyle(optional, default 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: SetCommentDisplayMode SetCommentSize GetCellComment SelectRangeByIndex SelectRangeByString SetRangeTooltip ::Office::GetUserName

SetRangeFillColor [::Excel]

Excel, Top

Set the fill color of a cell range.

SetRangeFillColor rangeId args

Parameters
rangeId Identifier of the cell range.
args Background fill color.
Return value

Returns no value.

Description

Set the fill color of a cell range.

Color value may be specified in a format acceptable by procedure ::Cawt::GetColor, i.e. color name, hexadecimal string, Office color number or a list of 3 integer RGB values.

See also: SetRangeTextColor ::Cawt::GetColor 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: SetRangeFontName SetRangeFontItalic SetRangeFontUnderline SetRangeFontSize SelectRangeByIndex

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: SetRangeFontName SetRangeFontBold SetRangeFontUnderline SetRangeFontSize SelectRangeByIndex

SetRangeFontName [::Excel]

Excel, Top

Set the font name of a cell or character range.

SetRangeFontName rangeId fontName

Parameters
rangeId Identifier of the cell range.
fontName Name of the font as a string.
Description

Set the font name of a cell or character range.

No return value.

See also: SetRangeFontSubscript SetRangeFontSuperscript SetRangeFontBold SetRangeFontSize SelectRangeByIndex

SetRangeFontSize [::Excel]

Excel, Top

Set the font size of a cell range.

SetRangeFontSize rangeId size

Parameters
rangeId Identifier of the cell range.
size Font size.
Description

Set the font size of a cell range.

The size value may be specified in a format acceptable by procedure Cawt::ValueToPoints, i.e. centimeters, inches or points.

No return value.

See also: SetRangeFontName SetRangeFontBold SetRangeFontItalic SetRangeFontUnderline SelectRangeByIndex ::Cawt::ValueToPoints

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: SetRangeFontName SetRangeFontSuperscript SelectRangeByIndex

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: SetRangeFontName SetRangeFontSubscript SelectRangeByIndex GetRangeCharacters

SetRangeFontUnderline [::Excel]

Excel, Top

Set the underline font style of a cell range.

SetRangeFontUnderline rangeId style

Parameters
rangeId Identifier of the cell range.
style(optional, default xlUnderlineStyleSingle) Value of enumeration type XlUnderlineStyle (see excelConst.tcl).
Description

Set the underline font style of a cell range.

No return value.

See also: SetRangeFontName SetRangeFontBold SetRangeFontItalic SetRangeFontSize SelectRangeByIndex

SetRangeFormat [::Excel]

Excel, Top

Set the number 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 GetNumberFormat procedure for specifying the sub-format. If subFmt is the empty string 2 digits after the decimal point are used.
Return value

Returns no value.

Description

Set the number format of a cell range.

If parameter fmt is not any of the predefined values, it is interpreted as a custom number format specified in Excel style.

See also: GetRangeFormat 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: GetRangeHorizontalAlignment 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 args

Parameters
rangeId Identifier of the cell range.
args Text color.
Return value

Returns no value.

Description

Set the text color of a cell range.

Color value may be specified in a format acceptable by procedure ::Cawt::GetColor, i.e. color name, hexadecimal string, Office color number or a list of 3 integer RGB values.

See also: SetRangeFillColor ::Cawt::GetColor 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

SetRangeValues [::Excel]

Excel, Top

Set range values from a matrix.

SetRangeValues rangeId matrixList

Parameters
rangeId Identifier of the cell range.
matrixList Matrix with table data.
Description

Set range values from a matrix.

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: GetRangeValues SetMatrixValues SetRowValues SetColumnValues SetCellValue

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

SetRangeWrapText [::Excel]

Excel, Top

Set the text wrapping mode of a cell range.

SetRangeWrapText rangeId onOff

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

Set the text wrapping mode of a cell range.

No return value.

See also: GetRangeWrapText SetRangeHorizontalAlignment SetRangeTextColor SelectRangeByIndex

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. 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.

The height value may be specified in a format acceptable by procedure Cawt::ValueToPoints, i.e. centimeters, inches or points.

No return value.

See also: SetRowsHeight SetColumnWidth ColumnCharToInt ::Cawt::ValueToPoints

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. 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.

The height value may be specified in a format acceptable by procedure Cawt::ValueToPoints, i.e. centimeters, inches or points.

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

SetSeriesLineWidth [::Excel]

Excel, Top

Set the line width of a series.

SetSeriesLineWidth seriesId width

Parameters
seriesId Identifier of the series.
width Line width.
Description

Set the line width of a series.

No return value.

See also: GetChartNumSeries GetChartSeries SetSeriesLineWidth

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 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.

Use zero for parameters wide or tall to automatically determine the 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: SetWorksheetOrientation SetWorksheetZoom SetWorksheetPrintOptions SetWorksheetPaperSize SetWorksheetMargins SetWorksheetHeader SetWorksheetFooter

SetWorksheetFooter [::Excel]

Excel, Top

Set the texts of the footer of a worksheet.

SetWorksheetFooter worksheetId args

Parameters
worksheetId Identifier of the worksheet.
args List of key value pairs specifying the footer text configure options and its values.
Return value

Returns no value.

Description

Set the texts of the footer of a worksheet.

Option keys:

-left

      Set the text of the left footer.

-center

      Set the text of the center footer.

-right

      Set the text of the right footer.

See also: SetWorksheetOrientation SetWorksheetFitToPages SetWorksheetZoom SetWorksheetPrintOptions SetWorksheetPaperSize SetWorksheetHeader SetWorksheetFooter

SetWorksheetHeader [::Excel]

Excel, Top

Set the texts of the header of a worksheet.

SetWorksheetHeader worksheetId args

Parameters
worksheetId Identifier of the worksheet.
args List of key value pairs specifying the header text configure options and its values.
Return value

Returns no value.

Description

Set the texts of the header of a worksheet.

Option keys:

-left

      Set the text of the left header.

-center

      Set the text of the center header.

-right

      Set the text of the right header.

See also: SetWorksheetOrientation SetWorksheetFitToPages SetWorksheetZoom SetWorksheetPrintOptions SetWorksheetPaperSize SetWorksheetHeader SetWorksheetFooter

SetWorksheetMargins [::Excel]

Excel, Top

Set the margins of a worksheet.

SetWorksheetMargins worksheetId args

Parameters
worksheetId Identifier of the worksheet.
args List of key value pairs specifying the margins configure options and its values.
Return value

Returns no value.

Description

Set the margins of a worksheet.

Option keys:

-top

      Set the size of the top margin.

-bottom

      Set the size of the bottom margin.

-left

      Set the size of the left margin.

-right

      Set the size of the right margin.

-footer

      Set the size of the footer margin.

-header

      Set the size of the header margin.

The margin values may be specified in a format acceptable by procedure Cawt::ValueToPoints, i.e. centimeters, inches or points.

Example:

    SetWorksheetMargins $worksheetId -top 1.5c -left 2i
    sets the top margin to 1.5 centimeters and the left margin to 2 inches.

See also: SetWorksheetOrientation SetWorksheetFitToPages SetWorksheetZoom SetWorksheetPrintOptions SetWorksheetPaperSize SetWorksheetHeader SetWorksheetFooter ::Cawt::ValueToPoints

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: SetWorksheetFitToPages SetWorksheetZoom SetWorksheetPrintOptions SetWorksheetPaperSize SetWorksheetMargins SetWorksheetHeader SetWorksheetFooter

SetWorksheetPaperSize [::Excel]

Excel, Top

Set the paper size of a worksheet.

SetWorksheetPaperSize worksheetId paperSize

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

Set the paper size of a worksheet.

No return value.

See also: SetWorksheetOrientation SetWorksheetFitToPages SetWorksheetZoom SetWorksheetPrintOptions SetWorksheetMargins SetWorksheetHeader SetWorksheetFooter

SetWorksheetPrintOptions [::Excel]

Excel, Top

Set printing options of a worksheet.

SetWorksheetPrintOptions worksheetId args

Parameters
worksheetId Identifier of the worksheet.
args List of key value pairs specifying the print configure options and its values.
Return value

Returns no value.

Description

Set printing options of a worksheet.

Option keys:

-gridlines

      Set the printing of grid lines. Value is of type bool.

-bw

      Set printing in black-white only. Value is of type bool.

-draft

      Set printing quality to draft mode. Value is of type bool.

-headings

      Set printing of headings. Value is of type bool.

-comments

      Set printing of comments.
      Value is of enumeration type XlPrintLocation (see excelConst.tcl).
      Typical values: xlPrintInPlace, xlPrintNoComments.

-errors

      Set printing of errors.
      Value is of enumeration type XlPrintErrors (see excelConst.tcl).
      Typical values: xlPrintErrorsDisplayed, xlPrintErrorsBlank.

See also: SetWorksheetOrientation SetWorksheetFitToPages SetWorksheetZoom SetWorksheetPaperSize SetWorksheetMargins SetWorksheetHeader SetWorksheetFooter

SetWorksheetTabColor [::Excel]

Excel, Top

Set the color of the tab of a worksheet.

SetWorksheetTabColor worksheetId args

Parameters
worksheetId Identifier of the worksheet.
args Tab color.
Return value

Returns no value.

Description

Set the color of the tab of a worksheet.

Color value may be specified in a format acceptable by procedure ::Cawt::GetColor, i.e. color name, hexadecimal string, Office color number or a list of 3 integer RGB values.

See also: SetRangeTextColor ::Cawt::GetColor 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: SetWorksheetOrientation SetWorksheetFitToPages SetWorksheetPrintOptions SetWorksheetPaperSize SetWorksheetMargins SetWorksheetHeader SetWorksheetFooter

ShowCellByIndex [::Excel]

Excel, Top

Show a cell identified by its 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 its row/column index.

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

See also: SelectCellByIndex

ShowWorksheet [::Excel]

Excel, Top

Show a worksheet.

ShowWorksheet worksheetId

Parameters
worksheetId Identifier of the worksheet.
Description

Show a worksheet.

See also: GetNumWorksheets GetWorksheetIdByName AddWorksheet

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.

Note: The contents of hidden columns are transfered to Excel and are hidden there, too.

      If the tablelist contains a column with automatic line numbering, this column is
      transfered to Excel, too. If this behaviour is not wished, use the DeleteColumn
      procedure to delete the corresponding column in Excel.

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

Parameters
worksheetId Identifier of the worksheet.
Return value

Returns no value.

Description

Unhide a worksheet, if it is hidden.

If the worksheet is hidden, it is made visible.

See also: SetWorksheetTabColor IsWorksheetVisible

UseImgTransparency [::Excel]

Excel, Top

Toggle usage of transparency channel of an image.

UseImgTransparency onOff

Parameters
onOff
Description

Toggle usage of transparency channel of an image.

Only valid for ImgToWorksheet and WorksheetToImg procedures.

See also: ImgToWorksheet WorksheetToImg

Visible [::Excel]

Excel, Top

Set or query the visibility of an Excel application window.

Visible appId visible

Parameters
appId Identifier of the Excel instance.
visible(optional, default ) true: Show the application window. false: Hide the application window. empty: Return the visbility status.
Description

Set or query the visibility of an Excel application window.

If parameter visible is not set or the empty string, the visibility status is returned as a boolean value. Otherwise 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

WorksheetToHtmlFile [::Excel]

Excel, Top

Write the values of a worksheet into a HTML table file.

WorksheetToHtmlFile worksheetId htmlFileName useTarget

Parameters
worksheetId Identifier of the worksheet.
htmlFileName Name of the HTML file.
useTarget(optional, default true) true: Generate a target attribute for hyperlinks. false: No target attribute for hyperlinks, i.e. link opens in same tab.
Description

Write the values of a worksheet into a HTML table file.

The following attributes are exported to the HTML file: Font: Name, size, style (bold, italic, underline). Column span across a row. Text and background color. Horizontal and vertical text alignment. Hyperlinks.

No return value.

See also: GetMatrixValues ExcelFileToHtmlFile WorksheetToMediaWikiFile WorksheetToWikitFile WorksheetToWordTable WorksheetToMatlabFile WorksheetToRawImageFile WorksheetToTablelist

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 UseImgTransparency ::Cawt::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 pixelType

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.
pixelType(optional, default float) Pixel type (byte, short, float).
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.

Note: The contents of hidden columns are transfered from Excel to the tablelist

      and are hidden there, too.

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

WriteHtmlFile [::Excel]

Excel, Top

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

WriteHtmlFile matrixList htmlFileName useHeader

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

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

See SetMatrixValues for the description of a matrix representation.

No return value.

See also: WorksheetToHtmlFile

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 pixelType

Parameters
matrixList Floating point matrix.
rawImgFile File name of the image.
pixelType(optional, default float) Pixel type (byte, short, float).
Description

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

Note: The matrix values are written as 1-channel image with given pixel type.

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 instance, if available. 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 instance, if available. 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 an Internet Explorer instance.

Quit appId

Parameters
appId Identifier of the Internet Explorer instance.
Description

Quit an Internet Explorer instance.

No return value.

See also: Open

Visible [::Explorer]

Explorer, Top

Toggle the visibility 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 visibility 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 instance, 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 instance, 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 instance.

Quit appId

Parameters
appId Identifier of the Matlab instance.
Description

Quit a Matlab instance.

No return value.

See also: Open

Visible [::Matlab]

Matlab, Top

Toggle the visibility 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 visibility 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 an OCR layout.

GetFullText layoutId

Parameters
layoutId Identifier of the OCR layout.
Description

Return the recognized text of an 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

::Office

Commands

ColorToRgb [::Office]

Office, Top

Obsolete: Replaced with ::Cawt::OfficeColorToRgb in version 2.2.0

ColorToRgb color

Parameters
color
Description

Obsolete: Replaced with ::Cawt::OfficeColorToRgb in version 2.2.0

GetActivePrinter [::Office]

Office, 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.

See also: SetPrinterCommunication

GetApplicationId [::Office]

Office, Top

Get the application identifier of an Office object.

GetApplicationId objId

Parameters
objId The identifier of an Office object.
Description

Get the application identifier of an Office object.

Office object are Workbooks, Worksheets, ...

See also: GetApplicationName IsApplicationId

GetApplicationName [::Office]

Office, Top

Get the name of an Office application.

GetApplicationName objId

Parameters
objId The identifier of an Office object.
Description

Get the name of an Office application.

Return the name of the application as a string.

See also: GetApplicationId IsApplicationId

GetApplicationVersion [::Office]

Office, Top

Get the version number of an Office application.

GetApplicationVersion objId

Parameters
objId The identifier of an Office object.
Description

Get the version number of an Office application.

Return the version of the application as a floating point number.

See also: GetApplicationId GetApplicationName

GetDocumentProperties [::Office]

Office, Top

Get document property names as a list.

GetDocumentProperties objId type

Parameters
objId The identifier of an Office object (Workbook, Document, Presentation).
type(optional, default ) Type of document properties ("Builtin" or "Custom"). If type is not specified or the empty string, both types of document properties are included in the list.
Description

Get document property names as a list.

Return a sorted Tcl list containing the names of all properties of the specified type.

See also: GetDocumentProperty SetDocumentProperty

GetDocumentProperty [::Office]

Office, Top

Get the value of a document property.

GetDocumentProperty objId propertyName

Parameters
objId The identifier of an Office object (Workbook, Document, Presentation).
propertyName The name of the property.
Description

Get the value of a document property.

Return the value of specified property. If the property value is not set or an invalid property name is given, the string "N/A" is returned.

See also: GetDocumentProperties SetDocumentProperty

GetEnum [::Office]

Office, Top

Get numeric value of an enumeration.

GetEnum enumOrString

Parameters
enumOrString Enumeration name
Return value

Returns the numeric value of an enumeration.

Description

Get numeric value of an enumeration.

See also: GetEnumName GetEnumTypes GetEnumVal GetEnumNames

GetEnumName [::Office]

Office, Top

Get name of a given enumeration type and numeric value.

GetEnumName enumType enumVal

Parameters
enumType Enumeration type
enumVal Enumeration numeric value.
Return value

Returns a list of names of a given enumeration type.

Description

Get name of a given enumeration type and numeric value.

See also: GetEnumNames GetEnumTypes GetEnumVal GetEnum

GetEnumNames [::Office]

Office, Top

Get names of a given enumeration type.

GetEnumNames enumType

Parameters
enumType Enumeration type
Return value

Returns a list of names of a given enumeration type.

Description

Get names of a given enumeration type.

See also: GetEnumName GetEnumTypes GetEnumVal GetEnum

GetEnumTypes [::Office]

Office, Top

Get available enumeration types.

GetEnumTypes

Return value

Returns a list of available enumeration types.

Description

Get available enumeration types.

See also: GetEnumName GetEnumNames GetEnumVal GetEnum

GetEnumVal [::Office]

Office, Top

Get numeric value of an enumeration name.

GetEnumVal enumName

Parameters
enumName Enumeration name
Return value

Returns the numeric value of an enumeration name.

Description

Get numeric value of an enumeration name.

See also: GetEnumName GetEnumTypes GetEnumNames GetEnum

GetInstallationPath [::Office]

Office, 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.

GetStartupPath [::Office]

Office, 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 [::Office]

Office, 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 [::Office]

Office, 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 [::Office]

Office, 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 [::Office]

Office, 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.

IsApplicationId [::Office]

Office, Top

Check, if Office object is an application identifier.

IsApplicationId objId

Parameters
objId The identifier of an Office object.
Description

Check, if Office object is an application identifier.

Return true, if objId is a valid Office application identifier. Otherwise return false.

See also: ::Cawt::IsComObject GetApplicationId GetApplicationName

RgbToColor [::Office]

Office, Top

Obsolete: Replaced with ::Cawt::RgbToOfficeColor in version 2.2.0

RgbToColor r g b

Parameters
r
g
b
Description

Obsolete: Replaced with ::Cawt::RgbToOfficeColor in version 2.2.0

SetDocumentProperty [::Office]

Office, Top

Set the value of a document property.

SetDocumentProperty objId propertyName propertyValue

Parameters
objId The identifier of an Office object (Workbook, Document, Presentation).
propertyName The name of the property to set.
propertyValue The value for the property as string.
Description

Set the value of a document property.

No return value.

If the property name is a builtin property, it's value is set. Otherwise either a new custom property is generated and it's value set or, if the custom property already exists, only it's value is set.

See also: GetDocumentProperties GetDocumentProperty

SetPrinterCommunication [::Office]

Office, Top

Enable or disable printer communication.

SetPrinterCommunication objId onOff

Parameters
objId The identifier of an Office object.
onOff true : Printer communication is enabled. false: Printer communication is disabled.
Description

Enable or disable printer communication.

Disable the printer communication to speed up the execution of code that sets PageSetup properties, ex. SetWorksheetPrintOptions. Enable the printer communication after setting properties to commit all cached PageSetup commands.

Note: This method is only available in Office 2010 or newer.

No return value.

See also: GetActivePrinter

ShowAlerts [::Office]

Office, 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.

::OneNote

Introduction

The OneNote namespace provides commands to control Microsoft OneNote.

Commands

FindNodeByName [::OneNote]

OneNote, Top

Get a specific node by name.

FindNodeByName domNode nodeType nodeName

Parameters
domNode DOM node.
nodeType Node type ("Notebook", "Section", "Page").
nodeName Node name.
Description

Get a specific node by name.

See also: FindNotebook FindSection FindPage GetNodeName

FindNotebook [::OneNote]

OneNote, Top

Get a specific notebook by name.

FindNotebook domNode nodeName

Parameters
domNode DOM root node as returned by GetDomRoot.
nodeName Node name.
Description

Get a specific notebook by name.

See also: FindNodeByName FindSection FindPage GetDomRoot GetNodeName

FindPage [::OneNote]

OneNote, Top

Get a specific page by name.

FindPage domNode nodeName

Parameters
domNode DOM node identifying a section.
nodeName Node name.
Description

Get a specific page by name.

See also: FindNodeByName FindNotebook FindSection GetPages GetNodeName

FindSection [::OneNote]

OneNote, Top

Get a specific section by name.

FindSection domNode nodeName

Parameters
domNode DOM node identifying a notebook.
nodeName Node name.
Description

Get a specific section by name.

See also: FindNodeByName FindNotebook FindPage GetSections GetNodeName

GetApplicationId [::OneNote]

OneNote, Top

Get the application identifier of a OneNote object.

GetApplicationId oneNoteId

Parameters
oneNoteId Identifier dict of a OneNote object.
Description

Get the application identifier of a OneNote object.

See also: Open GetDomId

GetDomId [::OneNote]

OneNote, Top

Get the DOM identifier of a OneNote object.

GetDomId oneNoteId

Parameters
oneNoteId Identifier dict of a OneNote object.
Description

Get the DOM identifier of a OneNote object.

See also: Open GetApplicationId GetDomRoot

GetDomRoot [::OneNote]

OneNote, Top

Get the DOM root of a OneNote object.

GetDomRoot oneNoteId

Parameters
oneNoteId Identifier dict of a OneNote object.
Description

Get the DOM root of a OneNote object.

See also: Open GetApplicationId GetDomId

GetEnum [::OneNote]

OneNote, Top

Get numeric value of an enumeration.

GetEnum enumOrString

Parameters
enumOrString Enumeration name
Return value

Returns the numeric value of an enumeration.

Description

Get numeric value of an enumeration.

See also: GetEnumTypes GetEnumVal GetEnumNames

GetEnumNames [::OneNote]

OneNote, Top

Get names of a given enumeration type.

GetEnumNames enumType

Parameters
enumType Enumeration type
Return value

Returns a list of names of a given enumeration type.

Description

Get names of a given enumeration type.

See also: GetEnumTypes GetEnumVal GetEnum

GetEnumTypes [::OneNote]

OneNote, Top

Get available enumeration types.

GetEnumTypes

Return value

Returns a list of available enumeration types.

Description

Get available enumeration types.

See also: GetEnumNames GetEnumVal GetEnum

GetEnumVal [::OneNote]

OneNote, Top

Get numeric value of an enumeration name.

GetEnumVal enumName

Parameters
enumName Enumeration name
Return value

Returns the numeric value of an enumeration name.

Description

Get numeric value of an enumeration name.

See also: GetEnumTypes GetEnumNames GetEnum

GetExtString [::OneNote]

OneNote, Top

Return the default extension of a OneNote file.

GetExtString oneNoteId

Parameters
oneNoteId Identifier dict of a OneNote object.
Description

Return the default extension of a OneNote file.

See also: Open GetVersion

GetLastModified [::OneNote]

OneNote, Top

Get nodes with specific modification date.

GetLastModified domNode compareDate nodeType notebookName

Parameters
domNode DOM node.
compareDate(optional, default 0) Date in seconds (as returned by clock seconds).
nodeType(optional, default any) Node type ("any", "Notebook", "Section", "Page").
notebookName(optional, default ) Notebook name.
Description

Get nodes with specific modification date.

See also: FindNotebook GetDomRoot

GetNodeAttribute [::OneNote]

OneNote, Top

Get attribute value of a DOM node.

GetNodeAttribute domNode attrName

Parameters
domNode DOM node.
attrName Attribute name.
Description

Get attribute value of a DOM node.

Return attribute value as string.

See also: GetNodeName GetNodeHyperLink

GetNodeHyperLink [::OneNote]

OneNote, Top

Get hyperlink to OneNote node.

GetNodeHyperLink oneNoteId domNode

Parameters
oneNoteId Identifier dict of a OneNote object.
domNode DOM node.
Description

Get hyperlink to OneNote node.

Return hyperlink as string.

See also: Open GetNodeAttribute GetNodeName

GetNodeName [::OneNote]

OneNote, Top

Get value of node attribute "name".

GetNodeName domNode

Parameters
domNode DOM node.
Description

Get value of node attribute "name".

Return attribute value as string.

See also: GetNodeAttribute GetNodeHyperLink

GetNodesByType [::OneNote]

OneNote, Top

Get nodes of specific type.

GetNodesByType domNode nodeType

Parameters
domNode DOM node.
nodeType Node type ("Notebook", "Section", "Page").
Description

Get nodes of specific type.

See also: GetNotebooks GetSections GetPages GetNodeType

GetNodeType [::OneNote]

OneNote, Top

Get type of a DOM node.

GetNodeType domNode

Parameters
domNode DOM node.
Description

Get type of a DOM node.

Return node type as string. Possible values: "Notebook", "Section", "Page".

See also: IsNodeType GetNodesByType

GetNotebooks [::OneNote]

OneNote, Top

Get the notebooks of a OneNote object.

GetNotebooks domNode

Parameters
domNode DOM root node as returned by GetDomRoot.
Description

Get the notebooks of a OneNote object.

See also: GetNodesByType GetSections GetPages GetDomRoot GetNodeType

GetPageContent [::OneNote]

OneNote, Top

Get page content as XML.

GetPageContent oneNoteId domNode

Parameters
oneNoteId Identifier dict of a OneNote object.
domNode DOM node of a page.
Description

Get page content as XML.

See also: Open PrintPage

GetPages [::OneNote]

OneNote, Top

Get the pages of a OneNote section.

GetPages domNode

Parameters
domNode DOM node identifying a section.
Description

Get the pages of a OneNote section.

See also: GetNodesByType GetSections GetPages FindSection GetNodeType

GetSections [::OneNote]

OneNote, Top

Get the sections of a OneNote notebook.

GetSections domNode

Parameters
domNode DOM node identifying a notebook.
Description

Get the sections of a OneNote notebook.

See also: GetNodesByType GetNotebooks GetPages FindNotebook GetNodeType

GetVersion [::OneNote]

OneNote, Top

Return the version of a OneNote application.

GetVersion oneNoteId useString

Parameters
oneNoteId Identifier dict of a OneNote object.
useString(optional, default false) true: Return the version name (ex. "OneNote 2010"). false: Return the version number (ex. "12.0").
Description

Return the version of a OneNote 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: Open GetExtString

IsNodeType [::OneNote]

OneNote, Top

Check, if node is of specific type.

IsNodeType domNode nodeType

Parameters
domNode DOM node.
nodeType Node type ("Notebook", "Section", "Page").
Description

Check, if node is of specific type.

Return true, if node is of specified type. Otherwise false.

See also: GetNodeType GetNodesByType

Open [::OneNote]

OneNote, Top

Open a OneNote instance.

Open

Description

Open a OneNote instance.

Return the identifier of the OneNote instance.

The identifier is a dictionary containing 2 elements: Key appId: The application identifier. Key docId: The DOM node identifier.

See also: Quit GetApplicationId GetDomId

PrintPage [::OneNote]

OneNote, Top

Print page content as XML to standard output.

PrintPage oneNoteId domNode

Parameters
oneNoteId Identifier dict of a OneNote object.
domNode DOM node of a page.
Description

Print page content as XML to standard output.

See also: GetPageContent

Quit [::OneNote]

OneNote, Top

Quit a OneNote instance.

Quit oneNoteId

Parameters
oneNoteId Identifier dict of a OneNote object.
Description

Quit a OneNote instance.

No return value.

See also: Open

::Outlook

Introduction

The Outlook namespace provides commands to control Microsoft Outlook.

Commands

AddAppointment [::Outlook]

Outlook, Top

Create a new appointment in an Outlook calendar.

AddAppointment calId args

Parameters
calId Identifier of the Outlook calendar.
args List of key value pairs specifying appointment configure options and its values.
Return value

Returns the identifier of the new appointment object.

Description

Create a new appointment in an Outlook calendar.

Option keys:

-subject <string>

      Set the subject text of the appointment.
      Default: No subject.

-startdate <string>

      Set the start date of the appointment in format "%Y-%m-%d %H:%M:%S".
      Default is today.

-enddate <string>

      Set the end date of the appointment in format "%Y-%m-%d %H:%M:%S".
      Default is today.

-category <string>

      Assign category to appointment. If specified category does not
      yet exist, it is created.
      Default: No category.

-location <string>

      Set the location of the appointment.
      Default: No location.

-body <string>

      Set the body text of the appointment.
      Default: No body text.

-alldayevent true|false

      Specify, if appointment is an all day event.
      Default: false

-reminder true|false

      Specify, if appointment has a reminder set.
      Default: true

-busystate <OlBusyStatus>

      Set the busy status of the appointment.
      Possible values: olBusy olFree olOutOfOffice olTentative olWorkingElsewhere
      Default: olBusy

-importance <OlImportance>

      Set the importance of the appointment.
      Possible values: olImportanceHigh olImportanceLow olImportanceNormal
      Default: olImportanceNormal

-sensitivity <OlSensitivity>

      Set the sensitivity of the appointment.
      Possible values: olConfidential olNormal olPersonal olPrivate
      Default: olNormal

-isrecurring

      Get the recurring flag of the appointment.
      Only available for procedure GetAppointmentProperties.

See also: CreateMail AddHolidayAppointment GetAppointmentProperties GetNumAppointments

AddCalendar [::Outlook]

Outlook, Top

Add a new calendar.

AddCalendar appId calendarName

Parameters
appId Identifier of the Outlook instance.
calendarName Name of the new calendar.
Return value

Returns the identifier of the new calendar.

Description

Add a new calendar.

If a calendar with given name is already existing, the identifier of that calendar is returned. If the calendar could not be added an error is thrown.

See also: GetNumCalendars HaveCalendar GetCalendarNames GetCalendarId DeleteCalendar

AddCategory [::Outlook]

Outlook, Top

Add a new category to the Outlook categories.

AddCategory appId name color

Parameters
appId Identifier of the Outlook instance.
name Name of the new category.
color(optional, default ) Value of enumeration type OlCategoryColor (see outlookConst.tcl) or category color name. If set to the empty string, a color is choosen automatically by Outlook.
Return value

Returns the identifier of the new category.

Description

Add a new category to the Outlook categories.

If a category with given name is already existing, the identifier of that category is returned.

See also: HaveCategory GetNumCategories GetCategoryNames GetCategoryId DeleteCategory GetCategoryColor

AddHolidayAppointment [::Outlook]

Outlook, Top

Create a new appointment in an Outlook calendar.

AddHolidayAppointment calId subject args

Parameters
calId Identifier of the Outlook calendar.
subject Subject text.
args List of key value pairs specifying appointment configure options and its values.
Return value

Returns the identifier of the new appointment object.

Description

Create a new appointment in an Outlook calendar.

Option keys:

-date

      Set the date of the appointment in format "%Y-%m-%d".
      Default is today.

-category

      Assign category to appointment. Value is of type string.
      Default: No category.

-location

      Set the location of the appointment. Value is of type string.
      Default: No location.

The appointment has the following properties automatically set:

  All-Day event, No reminder, OutOfOffice status.

See also: CreateMail AddAppointment ApplyHolidayFile GetNumAppointments

ApplyHolidayFile [::Outlook]

Outlook, Top

Read an Outlook holiday file and insert appointments.

ApplyHolidayFile calId fileName category

Parameters
calId Identifier of the Outlook calendar.
fileName Name of the Outlook holiday file.
category(optional, default ) Assign category to appointment. Default: No category.
Description

Read an Outlook holiday file and insert appointments.

No return value. If the holiday file could not be read, an error is thrown.

See also: ReadHolidayFile AddHolidayAppointment

CreateHtmlMail [::Outlook]

Outlook, Top

Create a new Outlook HTML mail.

CreateHtmlMail 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 in HTML format.
attachmentList(optional, default ) List of files used as attachment.
Return value

Returns the identifier of the new mail object.

Description

Create a new Outlook HTML mail.

See also: CreateMail SendMail

CreateMail [::Outlook]

Outlook, Top

Create a new Outlook text 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.
Return value

Returns the identifier of the new mail object.

Description

Create a new Outlook text mail.

See also: CreateHtmlMail SendMail

DeleteAppointmentByIndex [::Outlook]

Outlook, Top

Delete an appointment of an Outlook calendar by its index.

DeleteAppointmentByIndex calId index

Parameters
calId Identifier of the Outlook calendar.
index Index of the appointment.
Description

Delete an appointment of an Outlook calendar by its index.

No return value.

The first appointment has index 1. Instead of using the numeric index the special word "end" may be used to specify the last appointment. If the index is out of bounds an error is thrown.

See also: GetNumAppointments GetAppointmentByIndex AddAppointment

DeleteCalendar [::Outlook]

Outlook, Top

Delete an Outlook calendar.

DeleteCalendar calId

Parameters
calId Identifier of the Outlook calendar.
Description

Delete an Outlook calendar.

No return value.

See also: GetNumCalendars HaveCalendar GetCalendarNames GetCalendarId AddCalendar

DeleteCategory [::Outlook]

Outlook, Top

Delete an Outlook category.

DeleteCategory appId indexOrName

Parameters
appId
indexOrName Index or name of the Outlook category.
Description

Delete an Outlook category.

No return value.

See also: AddCategory HaveCategory GetNumCategories GetCategoryNames GetCategoryId DeleteCategory

GetAppointmentByIndex [::Outlook]

Outlook, Top

Get an appointment of an Outlook calendar by its index.

GetAppointmentByIndex calId index

Parameters
calId Identifier of the Outlook calendar.
index Index of the appointment.
Return value

Returns the identifier of the found appointment.

Description

Get an appointment of an Outlook calendar by its index.

The first appointment has index 1. Instead of using the numeric index the special word "end" may be used to specify the last appointment. If the index is out of bounds an error is thrown.

See also: GetNumAppointments DeleteAppointmentByIndex AddAppointment

GetAppointmentProperties [::Outlook]

Outlook, Top

Get properties of an appointment.

GetAppointmentProperties appointId args

Parameters
appointId Identifier of the Outlook appointment.
args List of keys specifying appointment configure options.
Return value

Returns the appointment properties as a list of values. The list elements have the same order as the list of keys.

Description

Get properties of an appointment.

Option keys:

See AddAppointment for a list of configure options.

See also: AddAppointment GetNumAppointments

GetCalendarId [::Outlook]

Outlook, Top

Get a calendar by its name.

GetCalendarId appId calendarName

Parameters
appId Identifier of the Outlook instance.
calendarName(optional, default ) Name of the calendar to find.
Return value

Returns the identifier of the found calendar.

Description

Get a calendar by its name.

If a calendar with given name does not exist an error is thrown.

See also: GetNumCalendars HaveCalendar GetCalendarNames AddCalendar DeleteCalendar

GetCalendarNames [::Outlook]

Outlook, Top

Get a list of calendar names.

GetCalendarNames appId

Parameters
appId Identifier of the Outlook instance.
Return value

Returns a list of calendar names.

Description

Get a list of calendar names.

See also: GetNumCalendars HaveCalendar GetCalendarId AddCalendar DeleteCalendar

GetCategoryColor [::Outlook]

Outlook, Top

Convert a category color enumeration or name into a hexadecimal Tcl color string representation.

GetCategoryColor colorEnumOrName

Parameters
colorEnumOrName A category color enumeration or name.
Return value

Returns the hexadecimal representation of the specified color, ex. "#00FFAA".

Description

Convert a category color enumeration or name into a hexadecimal Tcl color string representation.

Outlook category colors can be specified in one of the following representations:

  Enum: A value of enumeration OlCategoryColor (see outlookConst.tcl).
  Name: Enumeration name without prefix "olCategoryColor".
        Example: Name of Outlook::olCategoryColorBlack is "Black".

See also: ::Cawt::GetColor GetCategoryColorEnum GetCategoryColorName GetCategoryColorNames

GetCategoryColorEnum [::Outlook]

Outlook, Top

Convert a category color enumeration or name into a color enumeration.

GetCategoryColorEnum colorEnumOrName

Parameters
colorEnumOrName A category color enumeration or name.
Return value

Returns the category color enumeration.

Description

Convert a category color enumeration or name into a color enumeration.

See GetCategoryColor for a description of color enumerations and names.

See also: ::Cawt::GetColor GetCategoryColor GetCategoryColorName GetCategoryColorNames

GetCategoryColorName [::Outlook]

Outlook, Top

Convert a category color enumeration into a category color name.

GetCategoryColorName colorEnum

Parameters
colorEnum A category color enumeration.
Return value

Returns the category color name.

Description

Convert a category color enumeration into a category color name.

See GetCategoryColor for a description of color enumerations and names.

See also: ::Cawt::GetColor GetCategoryColor GetCategoryColorEnum GetCategoryColorNames

GetCategoryColorNames [::Outlook]

Outlook, Top

Get all category color names.

GetCategoryColorNames

Return value

Returns a list of all category color names.

Description

Get all category color names.

See GetCategoryColor for a description of color enumerations and names.

See also: ::Cawt::GetColor GetCategoryColor GetCategoryColorEnum GetCategoryColorName

GetCategoryId [::Outlook]

Outlook, Top

Get a category by its index or name.

GetCategoryId appId indexOrName

Parameters
appId Identifier of the Outlook instance.
indexOrName Index or name of the category.
Return value

Returns the identifier of the found category.

Description

Get a category by its index or name.

The first category has index 1. If the index is out of bounds or the category name does not exist, an error is thrown.

See also: HaveCategory GetNumCategories GetCategoryNames AddCategory DeleteCategory

GetCategoryNames [::Outlook]

Outlook, Top

Get a list of category names.

GetCategoryNames appId

Parameters
appId Identifier of the Outlook instance.
Return value

Returns a list of category names.

Description

Get a list of category names.

See also: HaveCategory GetNumCategories GetCategoryId AddCategory DeleteCategory

GetEnum [::Outlook]

Outlook, Top

Get numeric value of an enumeration.

GetEnum enumOrString

Parameters
enumOrString Enumeration name
Return value

Returns the numeric value of an enumeration.

Description

Get numeric value of an enumeration.

See also: GetEnumName GetEnumTypes GetEnumVal GetEnumNames

GetEnumName [::Outlook]

Outlook, Top

Get name of a given enumeration type and numeric value.

GetEnumName enumType enumVal

Parameters
enumType Enumeration type
enumVal Enumeration numeric value.
Return value

Returns a list of names of a given enumeration type.

Description

Get name of a given enumeration type and numeric value.

See also: GetEnumNames GetEnumTypes GetEnumVal GetEnum

GetEnumNames [::Outlook]

Outlook, Top

Get names of a given enumeration type.

GetEnumNames enumType

Parameters
enumType Enumeration type
Return value

Returns a list of names of a given enumeration type.

Description

Get names of a given enumeration type.

See also: GetEnumName GetEnumTypes GetEnumVal GetEnum

GetEnumTypes [::Outlook]

Outlook, Top

Get available enumeration types.

GetEnumTypes

Return value

Returns a list of available enumeration types.

Description

Get available enumeration types.

See also: GetEnumName GetEnumNames GetEnumVal GetEnum

GetEnumVal [::Outlook]

Outlook, Top

Get numeric value of an enumeration name.

GetEnumVal enumName

Parameters
enumName Enumeration name
Return value

Returns the numeric value of an enumeration name.

Description

Get numeric value of an enumeration name.

See also: GetEnumName GetEnumTypes GetEnumNames GetEnum

GetFoldersRecursive [::Outlook]

Outlook, Top

GetFoldersRecursive appId type

Parameters
appId
type

GetMailIds [::Outlook]

Outlook, Top

Get a list of mail identifiers.

GetMailIds appId

Parameters
appId Identifier of the Outlook instance.
Return value

Returns a list of mail identifiers.

Description

Get a list of mail identifiers.

See also: GetMailSubjects CreateMail SendMail

GetMailSubjects [::Outlook]

Outlook, Top

Get a list of mail subjects.

GetMailSubjects appId

Parameters
appId Identifier of the Outlook instance.
Return value

Returns a list of mail subjects.

Description

Get a list of mail subjects.

See also: GetMailIds CreateMail SendMail

GetNumAppointments [::Outlook]

Outlook, Top

Get the number of appointments in an Outlook calendar.

GetNumAppointments calId

Parameters
calId Identifier of the Outlook calendar.
Return value

Returns the number of Outlook appointments.

Description

Get the number of appointments in an Outlook calendar.

See also: GetAppointmentByIndex DeleteAppointmentByIndex AddAppointment

GetNumCalendars [::Outlook]

Outlook, Top

Get the number of Outlook calendars.

GetNumCalendars appId

Parameters
appId Identifier of the Outlook instance.
Return value

Returns the number of Outlook calendars.

Description

Get the number of Outlook calendars.

See also: HaveCalendar GetCalendarNames GetCalendarId AddCalendar DeleteCalendar

GetNumCategories [::Outlook]

Outlook, Top

Get the number of Outlook categories.

GetNumCategories appId

Parameters
appId Identifier of the Outlook instance.
Return value

Returns the number of Outlook categories.

Description

Get the number of Outlook categories.

See also: HaveCategory GetCategoryNames GetCategoryId AddCategory DeleteCategory

GetVersion [::Outlook]

Outlook, Top

Get the version of an Outlook application.

GetVersion objId useString

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

Returns the version of an Outlook application.

Description

Get the version of an 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: Open

HaveCalendar [::Outlook]

Outlook, Top

Check, if a calendar already exists.

HaveCalendar appId calendarName

Parameters
appId Identifier of the Outlook instance.
calendarName Name of the calendar to check.
Return value

Returns true, if the calendar exists, otherwise false.

Description

Check, if a calendar already exists.

See also: GetNumCalendars GetCalendarNames GetCalendarId AddCalendar DeleteCalendar

HaveCategory [::Outlook]

Outlook, Top

Check, if a category already exists.

HaveCategory appId categoryName

Parameters
appId Identifier of the Outlook instance.
categoryName Name of the category to check.
Return value

Returns true, if the category exists, otherwise false.

Description

Check, if a category already exists.

See also: HaveCategory GetCategoryNames GetCategoryId AddCategory DeleteCategory GetCategoryColor

Open [::Outlook]

Outlook, Top

Open an Outlook instance.

Open explorerType

Parameters
explorerType(optional, default olFolderInbox) Value of enumeration type OlDefaultFolders (see outlookConst.tcl). Typical values are: olFolderCalendar, olFolderInbox, olFolderTasks.
Return value

Returns the identifier of the Outlook application instance.

Description

Open an Outlook instance.

See also: OpenNew Quit

OpenNew [::Outlook]

Outlook, Top

Obsolete: Replaced with Open in version 2.4.1

OpenNew explorerType

Parameters
explorerType(optional, default olFolderInbox)
Description

Obsolete: Replaced with Open in version 2.4.1

Quit [::Outlook]

Outlook, Top

Quit an Outlook 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 an Outlook instance.

No return value.

See also: Open OpenNew

ReadHolidayFile [::Outlook]

Outlook, Top

Read an Outlook holiday file.

ReadHolidayFile fileName

Parameters
fileName Name of the Outlook holiday file.
Return value

Returns the data of the holiday file as a dict with the following keys: "SectionList" : The list of sections in the holiday file.

Description

Read an Outlook holiday file.

  For each section the following keys are set:
  "SubjectList_$section": The list of subjects of this section.
  "DateList_$section"   : The list of dates of this section.

If the holiday file could not be read, an error is thrown.

See also: AddHolidayAppointment ApplyHolidayFile

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 CreateHtmlMail

::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

AddShape [::Ppt]

Ppt, Top

Add a new shape to a slide.

AddShape slideId shapeType left top width height args

Parameters
slideId Identifier of the slide.
shapeType Value of enumeration type MsoAutoShapeType (see officeConst.tcl). Typical values: msoShapeRectangle, msoShapeBalloon, msoShapeOval.
left Left corner of the shape.
top Top corner of the shape.
width Width of the shape.
height Height of the shape.
args List of key value pairs specifying shape configure options and its values.
Return value

Returns the identifier of the new shape.

Description

Add a new shape to a slide.

The position and size values are specified in a format acceptable by procedure ::Cawt::ValueToPoints, i.e. centimeters, inches or points.

For a description of the configure options see ConfigureShape.

See also: ConnectShapes ConfigureShape GetNumSites

AddSlide [::Ppt]

Ppt, Top

Add a new slide to a presentation.

AddSlide presId type slideIndex

Parameters
presId Identifier of the presentation.
type(optional, default 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.

Return the identifier of the new slide.

See also: CopySlide GetNumSlides GetCustomLayoutName GetCustomLayoutId

AddTextbox [::Ppt]

Ppt, Top

Add a text box into a slide.

AddTextbox slideId left top width height

Parameters
slideId Identifier of the slide where the text box is inserted.
left X position of top-left text box position.
top Y position of top-left text box position.
width Width of text box.
height Height of text box.
Description

Add a text box into a slide.

The position and size values may be specified in a format acceptable by procedure Cawt::ValueToPoints, i.e. centimeters, inches or points.

Return the identifier of the new text box.

See also: AddTextboxText SetTextboxFontSize ::Cawt::ValueToPoints

AddTextboxText [::Ppt]

Ppt, Top

Add a text string to a text box.

AddTextboxText textboxId text addNewline

Parameters
textboxId Identifier of the text box where the text is inserted.
text The text to be inserted.
addNewline(optional, default false) Add a new line after the text.
Description

Add a text string to a text box.

No return value.

See also: AddTextbox SetTextboxFontSize

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

ConfigureConnector [::Ppt]

Ppt, Top

Configure a connector.

ConfigureConnector connId args

Parameters
connId Identifier of the connector.
args List of key value pairs specifying the connector configure options and its values.
Return value

Returns no value.

Description

Configure a connector.

Option keys:

-beginarrow

      Set the type of the begin arrow.
      Value is of enumeration type MsoArrowheadStyle (see officeConst.tcl).
      Typical values: msoArrowheadTriangle, msoArrowheadNone, msoArrowheadDiamond.

-endarrow

      Set the type of the end arrow.
      Value is of enumeration type MsoArrowheadStyle (see officeConst.tcl).
      Typical values: msoArrowheadTriangle, msoArrowheadNone, msoArrowheadDiamond.

-beginsite

      Set the begin site of the connector.
      Value is an integer. 1 is the top site and continues counter clockwise.

-endsite

      Set the end site of the connector.
      Value is an integer. 1 is the top site and continues counter clockwise.

-weight

      Set the weight (thickness) of the connector line.
      Value can be specified in a format acceptable by
      procedure ::Cawt::ValueToPoints, i.e. centimeters, inches or points.

-fillcolor

      Set the fill color of the connector.
      Value may be specified in a format acceptable by procedure ::Cawt::GetColor,
      i.e. color name, hexadecimal string, Office color number or a list of 3 integer RGB values.

-type

      Set the type of the connector.
      Value is of enumeration type MsoConnectorType (see officeConst.tcl).
      Typical values: msoConnectorStraight, msoConnectorElbow, msoConnectorCurve.

See also: ConnectShapes GetNumSites ::Cawt::GetColor ::Cawt::ValueToPoints

ConfigureShape [::Ppt]

Ppt, Top

Configure a shape.

ConfigureShape shapeId args

Parameters
shapeId Identifier of the shape.
args List of key value pairs specifying the shape configure options and its values.
Return value

Returns no value.

Description

Configure a shape.

Option keys:

-fillcolor

      Set the fill color of the shape.
      Value may be specified in a format acceptable by procedure ::Cawt::GetColor,
      i.e. color name, hexadecimal string, Office color number or a list of 3 integer RGB values.

-text

      Set the text displayed inside the shape. Value is of type string.

-textsize

      Set the font size of the shape text. Value is specified in a format acceptable by
      procedure Cawt::ValueToPoints, i.e. centimeters, inches or points.

-textcolor

      Set the text color of the shape.
      Value may be specified in a format acceptable by procedure ::Cawt::GetColor,
      i.e. color name, hexadecimal string, Office color number or a list of 3 integer RGB values.

-valign

      Value is of enumeration type MsoVerticalAnchor (see officeConst.tcl).
      Typical values: msoAnchorTop, msoAnchorMiddle, msoAnchorBottom.

See also: AddShape GetNumSites ::Cawt::ValueToPoints ::Cawt::GetColor

ConnectShapes [::Ppt]

Ppt, Top

Add a new connector connecting two shapes.

ConnectShapes slideId fromShapeId toShapeId args

Parameters
slideId Identifier of the slide.
fromShapeId Identifier of the source shape.
toShapeId Identifier of the target shape.
args List of key value pairs specifying connector configure options and its values.
Return value

Returns the identifier of the new connector.

Description

Add a new connector connecting two shapes.

For a description of the configure options see ConfigureConnector.

  • Default is a straight line connector (msoConnectorStraight) with an end arrow of type msoArrowheadTriangle.
  • The connector is automatically placed by Office using RerouteConnections.

See also: AddShape ConfigureConnector

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.
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.

The output file name must contain either a "%s" or a "%d" format. In the first case, it is assumed that each slide has a comment of the form "Export: Name", where "Name" is substituted for the "%s" format option. If the output file name contains a "%d" format option, the slide number is substituted instead.

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.
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.

The output file name must contain either a "%s" or a "%d" format. In the first case, it is assumed that each slide has a comment of the form "Export: Name", where "Name" is substituted for the "%s" format option. If the output file name contains a "%d" format option, the slide number is substituted instead.

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

GetCommentKeyValue [::Ppt]

Ppt, Top

Return the value of a key stored in a comment.

GetCommentKeyValue slideId key

Parameters
slideId Identifier of the slide.
key Key to search for.
Description

Return the value of a key stored in a comment.

All comments of the specified slide are search for strings of the form "Key: Value". If the key is found in the comments, the corresponding value is returned. Otherwise an empty string is returned.

See also: GetNumComments GetComments ExportSlides

GetComments [::Ppt]

Ppt, Top

Get the comment texts of a slide as a Tcl list.

GetComments slideId

Parameters
slideId Identifier of the slide.
Description

Get the comment texts of a slide as a Tcl list.

See also: GetNumComments GetCommentKeyValue

GetCustomLayoutId [::Ppt]

Ppt, Top

Get a custom layout by its 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 its 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 GetCustomLayoutName 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

GetEnum [::Ppt]

Ppt, Top

Get numeric value of an enumeration.

GetEnum enumOrString

Parameters
enumOrString Enumeration name
Return value

Returns the numeric value of an enumeration.

Description

Get numeric value of an enumeration.

See also: GetEnumName GetEnumTypes GetEnumVal GetEnumNames

GetEnumName [::Ppt]

Ppt, Top

Get name of a given enumeration type and numeric value.

GetEnumName enumType enumVal

Parameters
enumType Enumeration type
enumVal Enumeration numeric value.
Return value

Returns a list of names of a given enumeration type.

Description

Get name of a given enumeration type and numeric value.

See also: GetEnumNames GetEnumTypes GetEnumVal GetEnum

GetEnumNames [::Ppt]

Ppt, Top

Get names of a given enumeration type.

GetEnumNames enumType

Parameters
enumType Enumeration type
Return value

Returns a list of names of a given enumeration type.

Description

Get names of a given enumeration type.

See also: GetEnumName GetEnumTypes GetEnumVal GetEnum

GetEnumTypes [::Ppt]

Ppt, Top

Get available enumeration types.

GetEnumTypes

Return value

Returns a list of available enumeration types.

Description

Get available enumeration types.

See also: GetEnumName GetEnumNames GetEnumVal GetEnum

GetEnumVal [::Ppt]

Ppt, Top

Get numeric value of an enumeration name.

GetEnumVal enumName

Parameters
enumName Enumeration name
Return value

Returns the numeric value of an enumeration name.

Description

Get numeric value of an enumeration name.

See also: GetEnumName GetEnumTypes GetEnumNames GetEnum

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".

GetNumComments [::Ppt]

Ppt, Top

Return the number of comments of a slide.

GetNumComments slideId

Parameters
slideId Identifier of the slide.
Description

Return the number of comments of a slide.

See also: GetComments GetCommentKeyValue

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 GetCustomLayoutName GetCustomLayoutId

GetNumSites [::Ppt]

Ppt, Top

Return the number of sites of a shape.

GetNumSites shapeId

Parameters
shapeId Identifier of the shape.
Description

Return the number of sites of a shape.

A site is the anchor point of a shape, where the connectors are attached.

See also: AddShape ConfigureShape ConnectShapes

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 objId useString

Parameters
objId Identifier of a PowerPoint object 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.

See also: GetExtString

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.
top Y position of top-left image position.
width(optional, default -1) Width of image.
height(optional, default -1) Height of image.
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.

The position and size values may be specified in a format acceptable by procedure Cawt::ValueToPoints, i.e. centimeters, inches or points.

Return the identifier of the inserted image.

See also: ::Cawt::ValueToPoints

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 instance, 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 instance, 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 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 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

SetHyperlinkToSlide [::Ppt]

Ppt, Top

Create a hyperlink from a shape to a slide.

SetHyperlinkToSlide srcShapeId destSlideIdOrNum screenTip

Parameters
srcShapeId Identifier of the source shape.
destSlideIdOrNum Identifier or number of the destination slide.
screenTip(optional, default ) Text to be displayed when hovering over the source shape.
Description

Create a hyperlink from a shape to a slide.

No return value.

See also: AddShape ConfigureShape

SetPresPageSetup [::Ppt]

Ppt, Top

Set the page size of a presentation.

SetPresPageSetup presId args

Parameters
presId Identifier of the presentation.
args List of key value pairs specifying the page setup configure options and its values.
Description

Set the page size of a presentation.

Option keys:

-width

      Set the width of the presentation slides.

-height

      Set the height of the presentation slides.

The width and height values may be specified in a format acceptable by procedure Cawt::ValueToPoints, i.e. centimeters, inches or points.

No return value.

See also: AddPres OpenPres ::Cawt::ValueToPoints

SetTextboxFontSize [::Ppt]

Ppt, Top

Set the font size of the text in a text box.

SetTextboxFontSize textboxId fontSize

Parameters
textboxId Identifier of the text box where the text is inserted.
fontSize Font size.
Description

Set the font size of the text in a text box.

The size value may be specified in a format acceptable by procedure Cawt::ValueToPoints, i.e. centimeters, inches or points.

No return value.

See also: AddTextbox AddTextboxText

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

Go to first slide in slide show.

SlideShowFirst slideShowId

Parameters
slideShowId Identifier of the slide show.
Description

Go to first slide in slide show.

No return value.

See also: UseSlideShow SlideShowNext SlideShowPrev SlideShowLast

SlideShowLast [::Ppt]

Ppt, Top

Go to last slide in slide show.

SlideShowLast slideShowId

Parameters
slideShowId Identifier of the slide show.
Description

Go to last slide in slide show.

No return value.

See also: UseSlideShow SlideShowNext SlideShowPrev SlideShowFirst

SlideShowNext [::Ppt]

Ppt, Top

Go to next slide in slide show.

SlideShowNext slideShowId

Parameters
slideShowId Identifier of the slide show.
Description

Go to next slide in slide show.

No return value.

See also: UseSlideShow SlideShowPrev SlideShowFirst SlideShowLast

SlideShowPrev [::Ppt]

Ppt, Top

Go to previous slide in slide show.

SlideShowPrev slideShowId

Parameters
slideShowId Identifier of the slide show.
Description

Go to 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 visibility 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 visibility of a PowerPoint application window.

No return value.

See also: Open OpenNew

::Reader

Introduction

The Reader namespace provides commands to control Acrobat Reader.

Commands

Open [::Reader]

Reader, Top

Open an Acrobat Reader instance. Use an already running instance, if available.

Open fileName args

Parameters
fileName File name of PDF file to open.
args List of key value pairs specifying the startup options and its values.
Description

Open an Acrobat Reader instance. Use an already running instance, if available.

Option keys:

-nameddest

      Specify a named destination in the PDF document.

-page

      Specify a numbered page in the document, using an integer value.
      The document’s first page has a value of 1.

-zoom

      Specify a zoom factor in percent.

-pagemode

      Specify page display mode.
      Valid values: bookmarks thumbs none

-search

      Open the Search panel and perform a search for the
      words in the specified string. You can search only for single words.
      The first matching word is highlighted in the document.

-scrollbar

      Turn scrollbars on or off. Value is of type bool.

-toolbar

      Turn the toolbar on or off. Value is of type bool.

-statusbar

      Turn the status bar on or off. Value is of type bool.

-messages

      Turn document message bar on or off. Value is of type bool.

-navpanes

      Turn the navigation panes and tabs on or off. Value is of type bool.

Note, that above described options are only a subset of all available command line parameters. For a full list, see: http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf

No return value.

See also: OpenNew Quit

OpenNew [::Reader]

Reader, Top

Open a new Acrobat Reader instance.

OpenNew fileName args

Parameters
fileName File name of PDF file to open.
args List of key value pairs specifying the startup options and its values.
Description

Open a new Acrobat Reader instance.

For a detailled description of supported key value pairs see Open.

No return value.

See also: Open Quit

Quit [::Reader]

Reader, Top

Quit all Acrobat Reader instances.

Quit

Description

Quit all Acrobat Reader instances.

No return value.

See also: Open OpenNew

SetReaderProg [::Reader]

Reader, Top

Set the path to Acrobat Reader program.

SetReaderProg fileName

Parameters
fileName Full path name to Acrobat Reader program AcroRd32.exe
Description

Set the path to Acrobat Reader program.

Use this precure, if the automatic detection of the path to Acrobat Reader does not work. Note, that this procedure must be called before calling Open or OpenNew.

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.
Return value

Returns the bookmark identifier.

Description

Add a bookmark to a text range.

See also: SetLinkToBookmark GetBookmarkName

AddContentControl [::Word]

Word, Top

Add a content control to a text range.

AddContentControl rangeId type title

Parameters
rangeId Identifier of the text range.
type Value of enumeration type WdContentControlType (see wordConst.tcl). Often used values: wdContentControlCheckBox, wdContentControlText
title(optional, default ) Title string for the control.
Return value

Returns the content control identifier.

Description

Add a content control to a text range.

See also: SetContentControlText SetContentControlDropdown

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.
Return value

Returns the identifier of the new document.

Description

Add a new empty document to a Word instance.

See also: OpenDocument

AddImageTable [::Word]

Word, Top

Add a new table and fill the cells with images.

AddImageTable rangeId numCols imgList captionList

Parameters
rangeId Identifier of the text range.
numCols Number of columns of the new table.
imgList List of image file names.
captionList(optional, default ) List of caption texts.
Return value

Returns the identifier of the new table.

Description

Add a new table and fill the cells with images.

See also: AddTable InsertImage

AddPageBreak [::Word]

Word, Top

Add a page break to a text range.

AddPageBreak rangeId

Parameters
rangeId Identifier of the text range.
Return value

Returns no value.

Description

Add a page break to a text range.

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 after the range.
Return value

Returns the new extended range.

Description

Add a new paragraph to a document.

The spacing value may be specified in a format acceptable by procedure Cawt::ValueToPoints, i.e. centimeters, inches or points.

See also: AppendParagraph ::Cawt::ValueToPoints

AddRow [::Word]

Word, Top

Add one or more rows to a table.

AddRow tableId beforeRowNum numRows

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.
numRows(optional, default 1) Number of rows to be inserted.
Return value

Returns no value.

Description

Add one or more rows to a table.

See also: DeleteRow 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.
Return value

Returns the identifier of the new table.

Description

Add a new table in a text range.

The spacing value may be specified in a format acceptable by procedure Cawt::ValueToPoints, i.e. centimeters, inches or points.

See also: GetNumRows GetNumColumns ::Cawt::ValueToPoints

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 wdStyleNormal) Value of enumeration type WdBuiltinStyle (see wordConst.tcl).
Return value

Returns the new text range.

Description

Add text to a Word document.

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

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 after the range.
Return value

Returns no value.

Description

Append a paragraph at the end of the document.

The spacing value may be specified in a format acceptable by procedure Cawt::ValueToPoints, i.e. centimeters, inches or points.

See also: GetEndRange AddParagraph ::Cawt::ValueToPoints

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 wdStyleNormal) Value of enumeration type WdBuiltinStyle (see wordConst.tcl).
Return value

Returns the new text range.

Description

Append text to a Word document.

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

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.
Return value

Returns no value.

Description

Close a document without saving changes.

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

See also: SaveAs

ConfigureCaption [::Word]

Word, Top

Configure style of a caption type identified by its 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 wdCaptionNumberStyleArabic) Value of enumeration type WdCaptionNumberStyle (see wordConst.tcl).
separator(optional, default wdSeparatorHyphen) Value of enumeration type WdSeparatorType (see wordConst.tcl).
Return value

Returns no value.

Description

Configure style of a caption type identified by its label identifier.

See also: InsertCaption

CountWords [::Word]

Word, Top

Count words contained in a Word document.

CountWords docId args

Parameters
docId Identifier of the document.
args List of key value pairs specifying the counting configure options and its values.
Return value

Returns a key-value list containing the found words and their corresponding count.

Description

Count words contained in a Word document.

Option keys:

-sortmode <string>

       Sorting mode of output list.
       Default: length. Possible values: dictionary, length.

-minlength <int>

       Only count words having more than minlength characters.
       Default: No limit.

-maxlength <int>

       Only count words having less than maxlength characters.
       Default: No limit.

-shownumbers <bool>

       If set to false, only count words which are no numbers.

This procedure is used in the CAWT application WordAbbrCheck to get a list of words contained in a Word document.

See also: ::Cawt::CountWords

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.
Return value

Returns the identifier of the new text range.

Description

Create a 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.
Return value

Returns the identifier of the new text range.

Description

Create a new text range after specified range.

See also: CreateRange SelectRange GetSelectionRange

CropImage [::Word]

Word, Top

Crop an image at the four borders.

CropImage shapeId cropBottom cropTop cropLeft cropRight

Parameters
shapeId Identifier of the image inline shape.
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.
Return value

Returns no value.

Description

Crop an image at the four borders.

The crop values may be specified in a format acceptable by procedure Cawt::ValueToPoints, i.e. centimeters, inches or points.

See also: GetNumImages InsertImage ScaleImage ::Cawt::ValueToPoints

DeleteRow [::Word]

Word, Top

Delete a row of a table.

DeleteRow tableId row

Parameters
tableId Identifier of the Word table.
row(optional, default end) Row number. Row numbering starts with 1. If not specified or "end", the last row is deleted.
Return value

Returns no value.

Description

Delete a row of a table.

See also: AddRow GetNumRows

DiffWordFiles [::Word]

Word, Top

Compare two Word files visually.

DiffWordFiles wordBaseFile wordNewFile

Parameters
wordBaseFile Name of the base Word file.
wordNewFile Name of the new Word file.
Return value

Returns the identifier of the new Word application instance.

Description

Compare two Word files visually.

The two files are opened in Word's compare mode.

See also: OpenNew

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.
Return value

Returns the new extended range.

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.

See also: SetRangeStartIndex SetRangeEndIndex

FindString [::Word]

Word, Top

Find a string in a text range or a document.

FindString rangeOrDocId searchStr matchCase matchWildcards

Parameters
rangeOrDocId Identifier of a text range or a document identifier.
searchStr Search string.
matchCase(optional, default true) Flag indicating case sensitive search.
matchWildcards(optional, default false) Flag indicating wildcard search.
Return value

Returns zero, if string could not be found. Otherwise a positive integer. If the string was found, the selection is set to the found string.

Description

Find a string in a text range or a document.

See also: ReplaceString ReplaceByProc Search 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.
Return value

Returns no value.

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.

See also: SetHeaderRow

GetBookmarkName [::Word]

Word, Top

Get the name of a bookmark.

GetBookmarkName bookmarkId

Parameters
bookmarkId Identifier of the boormark.
Return value

Returns the name of the bookmark.

Description

Get the name of a 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.
Return value

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

Description

Return a cell of a Word table as a range.

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.
Return value

Returns the value of the specified cell as a string.

Description

Return the value of a Word table cell.

See also: SetCellValue IsValidCell

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.
Return value

Returns 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.

Description

Return a column of a Word table as a selection.

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.
Return value

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

Description

Return column values of a Word table 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.
Return value

Returns 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.

Description

Return the compatibility version of a Word application.

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 its index.

GetDocumentIdByIndex appId index

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

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

Description

Find a document by its index.

See also: GetNumDocuments GetDocumentName

GetDocumentName [::Word]

Word, Top

Get the name of a document.

GetDocumentName docId

Parameters
docId Identifier of the document.
Return value

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

Description

Get the name of a document.

GetEndRange [::Word]

Word, Top

Return the text range representing the end of the document.

GetEndRange docId

Parameters
docId Identifier of the document.
Return value

Returns the text range representing the end 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

GetEnum [::Word]

Word, Top

Get numeric value of an enumeration.

GetEnum enumOrString

Parameters
enumOrString Enumeration name
Return value

Returns the numeric value of an enumeration.

Description

Get numeric value of an enumeration.

See also: GetEnumName GetEnumTypes GetEnumVal GetEnumNames

GetEnumName [::Word]

Word, Top

Get name of a given enumeration type and numeric value.

GetEnumName enumType enumVal

Parameters
enumType Enumeration type
enumVal Enumeration numeric value.
Return value

Returns a list of names of a given enumeration type.

Description

Get name of a given enumeration type and numeric value.

See also: GetEnumNames GetEnumTypes GetEnumVal GetEnum

GetEnumNames [::Word]

Word, Top

Get names of a given enumeration type.

GetEnumNames enumType

Parameters
enumType Enumeration type
Return value

Returns a list of names of a given enumeration type.

Description

Get names of a given enumeration type.

See also: GetEnumName GetEnumTypes GetEnumVal GetEnum

GetEnumTypes [::Word]

Word, Top

Get available enumeration types.

GetEnumTypes

Return value

Returns a list of available enumeration types.

Description

Get available enumeration types.

See also: GetEnumName GetEnumNames GetEnumVal GetEnum

GetEnumVal [::Word]

Word, Top

Get numeric value of an enumeration name.

GetEnumVal enumName

Parameters
enumName Enumeration name
Return value

Returns the numeric value of an enumeration name.

Description

Get numeric value of an enumeration name.

See also: GetEnumName GetEnumTypes GetEnumNames GetEnum

GetExtString [::Word]

Word, Top

Return the default extension of a Word file.

GetExtString appId

Parameters
appId Identifier of the Word instance.
Return value

Returns the default extension of a Word file.

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

GetImageId [::Word]

Word, Top

Find an image by its index or name.

GetImageId docId indexOrName

Parameters
docId Identifier of the document.
indexOrName Index or name of the image to find.
Return value

Returns the identifier of the found image inline shape.

Description

Find an image by its index or name.

Image names are supported since Word 2010. If your Word version is older, an error is thrown.

If the index is out of bounds or the specified name does not exists, an error is thrown.

See also: GetNumImages InsertImage ReplaceImage SetImageName

GetImageName [::Word]

Word, Top

Return the name of an image.

GetImageName shapeId

Parameters
shapeId Identifier of the image inline shape.
Return value

Returns the name of an image.

Description

Return the name of an image.

Image names are supported since Word 2010. If your Word version is older, an error is thrown.

See also: GetNumImages SetImageName InsertImage GetImageId

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).
Return value

Returns the identifier of the specified list gallery.

Description

Get one of the 3 predefined list galleries.

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)
Return value

Returns the identifier of the specified list template.

Description

Get one of the 7 predefined list templates.

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.
Return value

Returns table values as a matrix.

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.
Return value

Returns the number of characters in a Word 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.
Return value

Returns the number of columns of a 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.
Return value

Returns the number of documents in a Word application.

Description

Return the number of documents in a Word application.

See also: AddDocument OpenDocument

GetNumImages [::Word]

Word, Top

Return the number of images of a Word document.

GetNumImages docId

Parameters
docId Identifier of the document.
Return value

Returns the number of images of a Word document.

Description

Return the number of images of a Word document.

See also: InsertImage ReplaceImage GetImageId SetImageName

GetNumRows [::Word]

Word, Top

Return the number of rows of a Word table.

GetNumRows tableId

Parameters
tableId Identifier of the Word table.
Return value

Returns the number of rows of a 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.
Return value

Returns the number of tables of a Word document.

Description

Return the number of tables of a Word document.

See also: AddTable GetNumRows GetNumColumns

GetRangeEndIndex [::Word]

Word, Top

Return the end index of a text range.

GetRangeEndIndex rangeId

Parameters
rangeId Identifier of the text range.
Return value

Returns the end index of a 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).
Return value

Returns the range information associated with the supplied type.

Description

Get information about a text range.

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.
Return value

Returns the start index of a 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.
Return value

Returns a range consisting of all cells of a row.

Description

Return a row of a Word table as a range.

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.
Return value

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

Description

Return row values of a Word table 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.
Return value

Returns the text range representing the current selection.

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.
Return value

Returns a text range representing the start 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 its index.

GetTableIdByIndex docId index

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

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

Description

Find a table by its index.

See also: GetNumTables

GetVersion [::Word]

Word, Top

Return the version of a Word application.

GetVersion objId useString

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

Returns the version of a Word application.

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 wdCaptionPositionBelow) Value of enumeration type WdCaptionPosition (see wordConst.tcl).
Return value

Returns the new extended range.

Description

Insert a caption into a range of a document.

See also: ConfigureCaption InsertFile InsertImage InsertList InsertText

InsertFile [::Word]

Word, Top

Insert a file into a Word document.

InsertFile rangeId fileName pasteFormat

Parameters
rangeId Identifier of the text range.
fileName Name of the file to insert.
pasteFormat(optional, default ) Value of enumeration type WdRecoveryType (see wordConst.tcl).
Return value

Returns no value.

Description

Insert a file into a Word document.

Insert an external file a the text range identified by rangeId. If pasteFormat is not specified or an empty string, the method InsertFile is used. Otherwise the external file is opened in a new Word document, copied to the clipboard and pasted into the text range. For pasting the PasteAndFormat method is used, so it is possible to merge the new text from the external file into the Word document in different ways.

See also: SetHyperlink InsertCaption InsertImage InsertList InsertText

InsertImage [::Word]

Word, Top

Insert an image into a range of a document.

InsertImage rangeId imgFileName linkToFile saveWithDoc

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 file.
saveWithDoc(optional, default true) Embed the image into the document.
Return value

Returns the identifier of the inserted image as an inline shape.

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.

See also: ScaleImage CropImage InsertFile InsertCaption InsertList InsertText

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 wdBulletGallery) Value of enumeration type WdListGalleryType (see wordConst.tcl).
listType(optional, default wdListListNumOnly) Value of enumeration type WdListType (see wordConst.tcl)
Return value

Returns the range of the Word list.

Description

Insert a Word list.

See also: GetListGalleryId GetListTemplateId InsertCaption InsertFile InsertImage InsertText

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 wdStyleNormal) Value of enumeration type WdBuiltinStyle (see wordConst.tcl).
Return value

Returns the new text range.

Description

Insert text in a Word document.

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

See also: AddText AppendText AddParagraph SetRangeStyle InsertCaption InsertFile InsertImage InsertList

IsValidCell [::Word]

Word, Top

Check, if a Word table cell is valid.

IsValidCell 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

Check, if a Word table cell is valid.

Return true, if the cell is valid, otherwise false.

See also: GetCellValue

Open [::Word]

Word, Top

Open a Word instance. Use an already running instance, 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.
Return value

Returns the identifier of the Word application instance.

Description

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

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.
Return value

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

Description

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

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.
Return value

Returns the identifier of the new Word application instance.

Description

Open a new Word 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.
Return value

Returns no value.

Description

Print the indices of a text range.

The range identifiers are printed onto standard output.

See also: GetRangeStartIndex GetRangeEndIndex

Quit [::Word]

Word, Top

Quit a Word 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.
Return value

Returns no value.

Description

Quit a Word instance.

See also: Open OpenNew

ReplaceByProc [::Word]

Word, Top

Replace a string in a text range. Procedural case.

ReplaceByProc rangeId str func args

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

Returns no value.

Description

Replace a string in a text range. Procedural 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 test script Word-04-Find.tcl for an example.

See also: FindString ReplaceString

ReplaceImage [::Word]

Word, Top

Replace an existing image.

ReplaceImage shapeId imgFileName args

Parameters
shapeId Identifier of the image inline shape.
imgFileName File name of the new image (as absolute path).
args List of key value pairs specifying the replacement options and its values.
Description

Replace an existing image.

Option keys:

-keepsize true|false

    Keep original image size. Default value is false.

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.

See also: InsertImage GetNumImages SetImageName

ReplaceString [::Word]

Word, Top

Replace a string in a text range or a document. Simple case.

ReplaceString rangeOrDocId searchStr replaceStr howMuch matchCase matchWildcards

Parameters
rangeOrDocId Identifier of a text range or a document identifier.
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.
matchWildcards(optional, default false) Flag indicating wildcard search.
Return value

Returns zero, if string could not be found and replaced. Otherwise a positive integer.

Description

Replace a string in a text range or a document. Simple case.

See also: FindString ReplaceByProc Search

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.
Return value

Returns no value.

Description

Save a document to a Word file.

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.
Return value

Returns no value.

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

See also: SaveAs

ScaleImage [::Word]

Word, Top

Scale an image.

ScaleImage shapeId scaleWidth scaleHeight

Parameters
shapeId Identifier of the image inline shape.
scaleWidth Horizontal scale factor.
scaleHeight Vertical scale factor.
Return value

Returns no value.

Description

Scale an image.

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

See also: GetNumImages InsertImage ReplaceImage CropImage

Search [::Word]

Word, Top

Search or replace a string in a text range or a document. Generic case.

Search rangeOrDocId searchStr args

Parameters
rangeOrDocId Identifier of a text range or a document identifier.
searchStr Search string.
args List of key value pairs specifying the search options and its values.
Return value

Returns zero, if string could not be found and replaced. Otherwise a positive integer.

Description

Search or replace a string in a text range or a document. Generic case.

Option keys:

See the Word reference documentation regarding Find.Execute at https://msdn.microsoft.com/en-us/library/office/ff193977.aspx for more details.

-matchcase

    Search in case sensitive mode. Value is of type bool.

-matchwholeword

    Search entire words only. Value is of type bool.

-matchwildcards

    Search with wild cards. Value is of type bool.

-matchsoundslike

    Search for strings that sound similar. Value is of type bool.

-matchallwordforms

    Search all forms of the search string. Value is of type bool.

-forward

    Search towards end of document. Value is of type bool.

-wrap

    Search wrap mode. Value is of type WdFindWrap (wdFindAsk, wdFindContinue, wdFindStop).

-format

    Search operation uses formatting in addition to the search string. Value is of type bool.

-replacewith

    Replacement text. Value is of type string.

-replace

    Number of replacements. Value is of type WdReplace(wdReplaceNone, wdReplaceOne, wdReplaceAll).

-matchkashida

    Match text with matching kashidas in an Arabic-language document. Value is of type bool.

-matchdiacritics

    Match text with matching diacritics in a right-to-left language document. Value is of type bool.

-matchalefhamza

    Match text with matching alef hamzas in an Arabic-language document. Value is of type bool.

-matchcontrol

    Match text with matching bidirectional control characters in a right-to-left language document.
    Value is of type bool.

-matchprefix

    Match words beginning with the search string. Value is of type bool.

-matchsuffix

    Match words ending with the search string. Value is of type bool.

-matchphrase

    Ignores all white space and control characters between words. Value is of type bool.

-ignorespace

     Ignore all white space between words. Value is of type bool.

-ignorepunct

     Ignore all punctuation characters between words. Value is of type bool.

See also: FindString ReplaceString ReplaceByProc

SelectRange [::Word]

Word, Top

Select a text range.

SelectRange rangeId

Parameters
rangeId Identifier of the text range.
Return value

Returns no value.

Description

Select a text range.

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.
Return value

Returns no value.

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.
Return value

Returns no value.

Description

Set the width of a range of table columns.

The size value may be specified in a format acceptable by procedure Cawt::ValueToPoints, i.e. centimeters, inches or points.

See also: SetColumnWidth ::Cawt::ValueToPoints

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).
Return value

Returns no value.

Description

Insert column values into a Word table.

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.
Return value

Returns no value.

Description

Set the width of a table column.

The size value may be specified in a format acceptable by procedure Cawt::ValueToPoints, i.e. centimeters, inches or points.

See also: SetColumnsWidth ::Cawt::ValueToPoints

SetCompatibilityMode [::Word]

Word, Top

Set the compatibility mode of a document.

SetCompatibilityMode docId mode

Parameters
docId Identifier of the document.
mode(optional, default wdWord2010) Compatibility mode of the document. Value of enumeration type WdCompatibilityMode (see wordConst.tcl).
Return value

Returns no value.

Description

Set the compatibility mode of a document.

Available only for Word 2010 and up.

See also: GetCompatibilityMode

SetContentControlDropdown [::Word]

Word, Top

SetContentControlDropdown controlId placeholderText keyValueList

Parameters
controlId
placeholderText
keyValueList

SetContentControlText [::Word]

Word, Top

SetContentControlText controlId placeholderText

Parameters
controlId
placeholderText

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.
Return value

Returns no value. If headerList is an empty list, an error is thrown.

Description

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

See also: SetRowValues FormatHeaderRow

SetHyperlink [::Word]

Word, Top

Insert an external 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.
Return value

Returns no value.

Description

Insert an external 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.

See also: SetHyperlinkToFile SetLinkToBookmark SetInternalHyperlink

SetHyperlinkToFile [::Word]

Word, Top

Insert a hyperlink to a file into a Word document.

SetHyperlinkToFile rangeId fileName textDisplay

Parameters
rangeId Identifier of the text range.
fileName Path name of the linked file.
textDisplay(optional, default ) Text to be displayed instead of the file name.
Return value

Returns no value.

Description

Insert a hyperlink to a file into a Word document.

See also: SetHyperlink SetLinkToBookmark SetInternalHyperlink

SetImageName [::Word]

Word, Top

Set the name of an image.

SetImageName shapeId name

Parameters
shapeId Identifier of the image inline shape.
name
Description

Set the name of an image.

No return value.

Image names are supported since Word 2010. If your Word version is older, an error is thrown.

See also: GetNumImages GetImageName InsertImage GetImageId

SetInternalHyperlink [::Word]

Word, Top

Insert an internal hyperlink into a Word document.

SetInternalHyperlink rangeId subAddress textDisplay

Parameters
rangeId Identifier of the text range.
subAddress Internal reference.
textDisplay(optional, default ) Text to be displayed instead of the URL.
Return value

Returns no value.

Description

Insert an internal hyperlink into a Word document.

See also: SetLinkToBookmark SetHyperlink SetHyperlinkToFile

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.
Return value

Returns no value.

Description

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

See also: AddBookmark GetBookmarkName SetHyperlink SetInternalHyperlink

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.
Return value

Returns no value.

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 } }

See also: GetMatrixValues

SetRangeBackgroundColor [::Word]

Word, Top

Set the background color of a table cell range.

SetRangeBackgroundColor rangeId args

Parameters
rangeId Identifier of the cell range.
args Text color.
Return value

Returns no value.

Description

Set the background color of a table cell range.

Color value may be specified in a format acceptable by procedure ::Cawt::GetColor, i.e. color name, hexadecimal string, Office color number or a list of 3 integer RGB values.

See also: SetRangeBackgroundColorByEnum SetRangeHighlightColorByEnum ::Cawt::GetColor

SetRangeBackgroundColorByEnum [::Word]

Word, Top

Set the background color of a table cell range.

SetRangeBackgroundColorByEnum rangeId colorEnum

Parameters
rangeId Identifier of the cell range.
colorEnum Value of enumeration type WdColor (see wordConst.tcl).
Return value

Returns no value.

Description

Set the background color of a table cell range.

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.
Return value

Returns no value.

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.

See also: SetRangeStartIndex GetRangeEndIndex

SetRangeFontBackgroundColor [::Word]

Word, Top

Set the background color of a text range.

SetRangeFontBackgroundColor rangeId args

Parameters
rangeId Identifier of the text range.
args Text color.
Return value

Returns no value.

Description

Set the background color of a text range.

Color value may be specified in a format acceptable by procedure ::Cawt::GetColor, i.e. color name, hexadecimal string, Office color number or a list of 3 integer RGB values.

See also: SetRangeBackgroundColor SetRangeHighlightColorByEnum ::Cawt::GetColor

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.
Return value

Returns no value.

Description

Toggle the bold font style of a text range.

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.
Return value

Returns no value.

Description

Toggle the italic font style of a text range.

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.
Return value

Returns no value.

Description

Set the font name of a text range.

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.
Return value

Returns no value.

Description

Set the font size of a text range.

The size value may be specified in a format acceptable by procedure Cawt::ValueToPoints, i.e. centimeters, inches or points.

See also: SetRangeFontName SetRangeFontBold SetRangeFontItalic SetRangeFontUnderline ::Cawt::ValueToPoints

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 wdColorAutomatic) Value of enumeration type WdColor (see wordConst.tcl)
Return value

Returns no value.

Description

Toggle the underline font style of a text range.

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 WdColorIndex (see wordConst.tcl).
Return value

Returns no value.

Description

Set the highlight color of a text range.

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.
Return value

Returns no value.

Description

Set the horizontal alignment of a text range.

See also: SetRangeHighlightColorByEnum

SetRangeMergeCells [::Word]

Word, Top

Merge a range of cells.

SetRangeMergeCells rangeId

Parameters
rangeId Identifier of the cell range.
Description

Merge a range of cells.

No return value.

See also: SetRangeHorizontalAlignment SelectRange

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.
Return value

Returns no value.

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.

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
Return value

Returns no value.

Description

Set the style of a text range.

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).
Return value

Returns no value. If valList is an empty list, an error is thrown.

Description

Insert row values from a Tcl list.

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 wdLineStyleSingle) Outside border style.
insideLineStyle(optional, default wdLineStyleSingle) 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 wdLineWidth050pt) Outside border line width.
insideLineWidth(optional, default wdLineWidth050pt) 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
Return value

Returns no value.

Description

Toggle checking of grammatical and spelling errors.

See also: Open

TrimString [::Word]

Word, Top

Trim a string.

TrimString str

Parameters
str String to be trimmed.
Return value

Returns the trimmed string.

Description

Trim a string.

The string is trimmed from the left and right side. Trimmed characters are whitespaces. Additionally the following control characters are converted: 0xD to \n, 0x7 to space.

UpdateFields [::Word]

Word, Top

Update all fields as well as tables of content and figures of a document.

UpdateFields docId

Parameters
docId Identifier of the document.
Return value

Returns no value.

Description

Update all fields as well as tables of content and figures of a document.

See also: SaveAs

Visible [::Word]

Word, Top

Toggle the visibility 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.
Return value

Returns no value.

Description

Toggle the visibility of a Word application window.

See also: Open OpenNew

Document generated by Ruff!