The Cawt namespace provides commands for basic automation functionality.
Convert centimeter value into points.
cm | Floating point centimeter value to be converted to points. |
Convert centimeter value into points.
Return the corresponding value in points.
See also: SetDotsPerInch InchesToPoints
Check, if 2 lists are identical.
expected | Expected list. |
value | Test list. |
msg | Message for test case. |
Check, if 2 lists are identical.
Print message and return true, if both lists are identical. Otherwise, print message (prepended with "Error:") and return false.
Check, if 2 matrices are identical.
expected | Expected matrix. |
value | Test matrix. |
msg | Message for test case. |
Check, if 2 matrices are identical.
Print message and return true, if both matrices are identical. Otherwise, print message (prepended with "Error:") and return false.
Check, if 2 numerical values are identical.
expected | Expected numeric value. |
value | Test numeric value. |
msg | Message for test case. |
Check, if 2 numerical values are identical.
Print message and return true, if both numeric values are identical. Otherwise, print message (prepended with "Error:") and return false.
Check, if 2 string values are identical.
expected | Expected string value. |
value | Test string value. |
msg | Message for test case. |
Check, if 2 string values are identical.
Print message and return true, if both string values are identical. Otherwise, print message (prepended with "Error:") and return false.
Copy the clipboard content into a photo image.
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
Destroy one or all COM objects.
comObj | (optional, default ) The COM object to be destroyed. |
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.
Get the name of the active printer.
appId | The application identifier. |
Get the name of the active printer.
Return the name of the active printer as a string.
Get the application identifier of an Office component.
componentId | The identifier of an Office component. |
Get the application identifier of an Office component.
Office components are Workbooks, Worksheets, ...
Get the name of an Office application.
appId | The application identifier. |
Get the name of an Office application.
Return the name of the application as a string.
Return the dots-per-inch value used for conversions.
Return the dots-per-inch value used for conversions.
See also: SetDotsPerInch
Get the Office installation pathname.
appId | The application identifier. |
Get the Office installation pathname.
Return the installation pathname as a string.
Use or create an instance of an application.
appName | The name of the application to be create or used. |
useExistingFirst | Prefer an already running application. |
Use or create an instance of an application.
Application names supported and tested with Cawt are: "Excel.Application", "PowerPoint.Application", "Word.Application", "GoogleEarth.ApplicationGE", "Matlab.Application". Note: There are higher level functions "Open" and "OpenNew" for the Cawt sub-packages.
If "useExistingFirst" is set to true, it is checked, if an application instance is already running. If true, this instance is used. If no running application is available, a new instance is started.
Return the application identifier.
See also: KillApp
Get the version of a Cawt sub-package.
pkgName | The name of the sub-package |
Get the version of a Cawt sub-package.
The version is returned as a string.
See also: HavePkg
Get the Office startup pathname.
appId | The application identifier. |
Get the Office startup pathname.
Return the startup pathname as a string.
Get the Office templates pathname.
appId | The application identifier. |
Get the Office templates pathname.
Return the templates pathname as a string.
Get the Office user library pathname.
appId | The application identifier. |
Get the Office user library pathname.
Return the user library pathname as a string.
Get the name of the Office application user.
appId | The application identifier. |
Get the name of the Office application user.
Return the name of the application user as a string.
Get the Office user folder's pathname.
appId | The application identifier. |
Get the Office user folder's pathname.
Return the user folder's pathname as a string.
Check, if a Cawt sub-package is available.
pkgName | The name of the sub-package. |
Check, if a Cawt sub-package is available.
Return true, if sub-package pkgName was loaded successfully. Otherwise return false.
See also: GetPkgVersion
Copy a photo image into the clipboard.
phImg | The photo image identifier. |
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
Convert inch value into points.
inches | Floating point inch value to be converted to points. |
Convert inch value into points.
Return the corresponding value in points.
See also: SetDotsPerInch CentiMetersToPoints
Check, if a COM object is valid.
comObj | The COM object. |
Check, if a COM object is valid.
Return true, if "comObj" is a valid object. Otherwise return false.
Kill all running instances of an application.
progName | The application's program name, as shown in the task manager. |
Kill all running instances of an application.
No return value.
See also: GetOrCreateApp
Return a RGB color as an Office color number.
r | The red component of the color |
g | The green component of the color |
b | The blue component of the color |
Return a RGB color as an Office color number.
The r, g and b values are specified as integers in the range 0 .. 255.
Return the color number as an integer.
Set the dots-per-inch value used for conversions.
dpi | Integer dpi value. |
Set the dots-per-inch value used for conversions.
If the dpi value is not explicitely set with this function, it's default value is 72.
No return value.
See also: GetDotsPerInch
Toggle the display of Office alerts.
appId | The application identifier. |
onOff | Switch the alerts on or off. |
Toggle the display of Office alerts.
No return value.
Cast a value to a boolean.
val | The value to be casted. |
Cast a value to a boolean.
Return true, if val is not equal to zero or true. Return false, if val is equal to zero or false.
See also: TclInt
Cast a value to an integer with boolean range.
val | The value to be casted. |
Cast a value to an integer with boolean range.
Return 1, if val is not equal to zero or true. Return 0, if val is equal to zero or false.
See also: TclBool
The Earth namespace provides commands to control Google Earth.
Check, if a GoogleEarth instance is initialized.
appId | Identifier of the GoogleEarth instance. |
Check, if a GoogleEarth instance is initialized.
Return true or false dependent on the initialization status.
Open a GoogleEarth instance. Use an already running GoogleEarth, if available.
Open a GoogleEarth instance. Use an already running GoogleEarth, if available.
Return the identifier of the GoogleEarth application instance.
Open a new GoogleEarth instance.
Open a new GoogleEarth instance.
Return the identifier of the new GoogleEarth application instance.
Quit a GoogleEarth application instance.
appId | Identifier of the GoogleEarth instance. |
Quit a GoogleEarth application instance.
No return value.
See also: Open
Save a grey-scale image of the current view.
appId | Identifier of the GoogleEarth instance. |
fileName | Name of image file. |
quality | (optional, default 80) Quality of the JPEG compression in percent. |
Save a grey-scale image of the current view.
No return value.
Set camera position and orientation.
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. |
Set camera position and orientation.
No return value.
The Excel namespace provides commands to control Microsoft Excel.
Add a clustered column chart to a worksheet. Simple case.
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. |
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
Add a line chart to a worksheet. Generic case.
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. |
Add a line chart to a worksheet. Generic case.
The data range for the "numCols" lines starts at (startRow, startCol) and goes to (startRow+numRows-1, startCol+numCols-1).
Return the identifier of the added chart.
See also: CreateChart AddLineChartSimple AddPointChartSimple AddRadarChartSimple
Add a line chart to a worksheet. Simple case.
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. |
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
Add a point chart to a worksheet. Simple case.
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. |
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
Add a radar chart to a worksheet. Simple case.
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. |
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
Add a new workbook with 1 worksheet.
appId | Identifier of the Excel instance. |
type | (optional, default $::Excel::xlWorksheet) Value of enumeration type XlSheetType. Possible values: xlChart, xlDialogSheet, xlExcel4IntlMacroSheet, xlExcel4MacroSheet, xlWorksheet |
Add a new workbook with 1 worksheet.
Return the identifier of the new workbook.
See also: OpenWorkbook Close SaveAs
Add a new worksheet to the end of a workbook.
workbookId | Identifier of the workbook containing the new worksheet. |
name | Name of the new worksheet. |
visibleType | (optional, default $::Excel::xlSheetVisible) Value of enumeration type XlSheetVisibility (see excelConst.tcl). Possible values: xlSheetVisible, xlSheetHidden, xlSheetVeryHidden |
Add a new worksheet to the end of a workbook.
Return the identifier of the new worksheet.
See also: GetNumWorksheets DeleteWorksheet
Copy a chart object to the clipboard.
chartObjId | Identifier of the chart object. |
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
Obsolete: Replaced with ChartObjToClipboard in version 1.0.1
chartId |
Obsolete: Replaced with ChartObjToClipboard in version 1.0.1
Return the matrix values contained in the clipboard.
sepChar | (optional, default ;) The separation character of the clipboard matrix data. |
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
Insert the matrix values contained in the clipboard into a worksheet.
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. |
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 a workbook without saving changes.
workbookId | Identifier of the workbook. |
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
Return an Excel column string as a column number.
colChar | Column string. |
Return an Excel column string as a column number.
Example: [ColumnCharToInt A] returns 1.
[::Excel::ColumnCharToInt Z] returns 26.
See also: ColumnIntToChar
Return a column number as an Excel column string.
col | Column number. |
Return a column number as an Excel column string.
Example: [ColumnIntToChar 1] returns "A".
[::Excel::ColumnIntToChar 26] returns "Z".
See also: ColumnCharToInt
Copy the contents of a worksheet into another worksheet.
fromWorksheetId | Identifier of the source worksheet. |
toWorksheetId | Identifier of the destination worksheet. |
Copy the contents of a worksheet into another worksheet.
No return value.
See also: SelectAll AddWorksheet
Create a new empty chart in a worksheet.
worksheetId | Identifier of the worksheet. |
chartType | Value of enumeration type XlChartType (see excelConst.tcl). |
Create a new empty chart in a worksheet.
Return the identifier of the new chart.
See also: PlaceChart AddLineChart AddLineChartSimple AddPointChartSimple AddRadarChartSimple
Return a CSV encoded row as a list of column values.
rowStr | CSV encoded row as string. |
Return a CSV encoded row as a list of column values.
See also: ListToCsvRow
Return a matrix from a CSV encoded table string.
csvString | CSV encoded table as string. |
Return a matrix from a CSV encoded table string.
See also: MatrixToCsvString CsvRowToList
Delete a worksheet.
workbookId | Identifier of the workbook containing the worksheet. |
worksheetId | Identifier of the worksheet to delete. |
Delete a worksheet.
No return value. If the number of worksheets before deletion is 1, an error is thrown.
See also: DeleteWorksheetByIndex GetWorksheetIdByIndex AddWorksheet
Delete a worksheet identified by it's index.
workbookId | Identifier of the workbook containing the worksheet. |
index | Index of the worksheet to delete. |
Delete a worksheet identified by it's index.
No return value. The left-most worksheet has index 1. If the index is out of bounds, or the number of worksheets before deletion is 1, an error is thrown.
See also: GetNumWorksheets GetWorksheetIdByIndex AddWorksheet
Convert an Excel file to a Matlab table file.
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. |
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
Convert an Excel file to a MediaWiki table file.
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. |
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
Convert an Excel file to a raw photo image file.
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. |
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
Convert an Excel file to a Wikit table file.
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. |
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
Format a row as a header row.
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. |
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
Return the active workbook of an application.
appId | Identifier of the Excel instance. |
Return the active workbook of an application.
Return the identifier of the active workbook.
See also: OpenWorkbook
Return a cell of a worksheet.
worksheetId | Identifier of the worksheet. |
row | Row number. Row numbering starts with 1. |
col | Column number. Column numbering starts with 1. |
Return a cell of a worksheet.
Return the cell identifier of the cell with index (row, col).
See also: SelectCellByIndex AddWorksheet
Return a numeric cell range as an Excel range string.
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 a numeric cell range as an Excel range string.
Example: [GetCellRange 1 2 5 7] returns string "B1:G5".
See also: GetColumnRange
Return the cells identifier of a worksheet.
worksheetId | Identifier of the worksheet. |
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.
Return the value of a cell.
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". |
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
Return a numeric column range as an Excel range string.
col1 | Column number of the left-most column. |
col2 | Column number of the right-most column. |
Return a numeric column range as an Excel range string.
Example: [GetColumnRange 2 7] returns string "B:G".
See also: GetCellRange
Return column values as a Tcl list.
worksheetId | Identifier of the worksheet. |
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 column values as a Tcl list.
Return the values of the specified column or column range as a Tcl list.
See also: SetColumnValues GetRowValues GetCellValue ColumnCharToInt GetNumUsedRows
Return the column separator character.
Return the column separator character.
Return the default extension of an Excel file.
appId | Identifier of the Excel instance. |
Return the default extension of an Excel file.
Starting with Excel 12 (2007) this is the string ".xlsx". In previous versions it was ".xls".
Return the decimal separator used by Excel.
Return the decimal separator used by Excel.
Only valid, after a call of Open or OpenNew.
See also: GetVersion
Return an Excel number format string.
pre | Number of digits before the decimal point. |
post | Number of digits after the decimal point. |
Return an Excel number format string.
The number of digits is specified as a string containing as many zeros as wanted digits.
Example: [GetLangNumberFormat "0" "0000"] will return the Excel format string to show
floating point values with 4 digits after the decimal point.
See also: SetRangeFormat
Return worksheet table values as a matrix.
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. |
Return worksheet table values as a matrix.
See also: SetMatrixValues GetRowValues GetColumnValues
Return the number of columns of a cell range.
rangeId | Identifier of a range, cells collection or a worksheet. |
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: GetNumUsedColumns GetNumRows
Return the number of rows of a cell range.
rangeId | Identifier of a range, cells collection or a worksheet. |
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: GetNumUsedRows GetNumColumns
Return the number of used columns of a worksheet.
worksheetId | Identifier of the worksheet. |
Return the number of used columns of a worksheet.
In some cases the number of columns returned may be 1 to high.
See also: GetNumColumns GetNumUsedRows
Return the number of used rows of a worksheet.
worksheetId | Identifier of the worksheet. |
Return the number of used rows of a worksheet.
See also: GetNumRows GetNumUsedColumns
Return the number of worksheets in a workbook.
workbookId | Identifier of the workbook. |
Return the number of worksheets in a workbook.
See also: AddWorksheet OpenWorkbook
Return row values as a Tcl list.
worksheetId | Identifier of the worksheet. |
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 row values as a Tcl list.
Return the values of the specified row or row range as a Tcl list.
See also: SetRowValues GetColumnValues GetCellValue ColumnCharToInt GetNumUsedColumns
Return the header line of a tablelist as a list.
tableId | Identifier of the tablelist. |
Return the header line of a tablelist as a list.
See also: TablelistToWorksheet WorksheetToTablelist SetTablelistHeader GetTablelistValues
Return the values of a tablelist as a matrix.
tableId | Identifier of the tablelist. |
Return the values of a tablelist as a matrix.
See also: TablelistToWorksheet WorksheetToTablelist SetTablelistValues GetTablelistHeader
Return the version of an Excel application.
appId | Identifier of the Excel instance. |
useString | (optional, default false) true: Return the version name (ex. "Excel 2000"). false: Return the version number (ex. "9.0"). |
Return the version of an Excel application.
Both version name and version number are returned as strings. Version number is in a format, so that it can be evaluated as a floating point number.
See also: GetFloatSeparator
Find a worksheet by it's index.
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. |
Find a worksheet by it's index.
Return the identifier of the found worksheet. The left-most worksheet has index 1. If the index is out of bounds an error is thrown.
See also: GetNumWorksheets GetWorksheetIdByName AddWorksheet
Find a worksheet by it's name.
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. |
Find a worksheet by it's name.
Return the identifier of the found worksheet. If a worksheet with given name does not exist an error is thrown.
See also: GetNumWorksheets GetWorksheetIdByIndex AddWorksheet
Return the name of a worksheet.
worksheetId | Identifier of the worksheet. |
Return the name of a worksheet.
See also: SetWorksheetName AddWorksheet
Insert an image into a worksheet.
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. |
Insert an image into a worksheet.
The file name of the image must be an absolute pathname. Use a construct like [file join [pwd] "myImage.gif"] to insert images from the current directory.
Return the identifier of the inserted image.
See also: ScaleImage
Return a list of column values as a CSV encoded row string.
rowList | List of column values. |
Return a list of column values as a CSV encoded row string.
See also: CsvRowToList
Convert a Matlab table file to an Excel file.
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. |
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
Insert the data values of a Matlab file into a worksheet.
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. |
Insert the data values of a Matlab file into a worksheet.
The header information are as follows: MatlabVersion Width Height
Note: Only Matlab Level 4 files are currently supported.
No return value.
See also: WorksheetToMatrixValues SetMatrixValues WikitFileToWorksheet MediaWikiFileToWorksheet RawImageFileToWorksheet TablelistToWorksheet WordTableToWorksheet
Copy a matrix into the clipboard.
matrixList | Matrix with table data. |
sepChar | (optional, default ;) The separation character of the clipboard matrix data. |
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
Return a CSV encoded table string from a matrix list.
matrixList | Matrix with table data. |
Return a CSV encoded table string from a matrix list.
See also: CsvStringToMatrix ListToCsvRow
Convert a MediaWiki table file to an Excel file.
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. |
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
Insert the values of a MediaWiki table file into a worksheet.
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. |
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 an Excel instance. Use an already running Excel, if available.
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. |
Open an Excel instance. Use an already running Excel, if available.
Return the identifier of the Excel application instance.
See also: OpenNew Quit Visible
Open a new Excel instance.
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. |
Open a new Excel instance.
Return the identifier of the new Excel application instance.
Open a workbook, i.e load an Excel file.
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. |
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
Place an existing chart into a worksheet.
chartId | Identifier of the chart. |
worksheetId | Identifier of the worksheet. |
Place an existing chart into a worksheet.
Return the ChartObject identifier of the placed chart.
See also: CreateChart SetChartObjSize SetChartObjPosition
Quit an Excel application instance.
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. |
Quit an Excel application instance.
No return value.
Convert a raw photo image file to an Excel file.
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. |
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
Insert the pixel values of a raw photo image into a worksheet.
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. |
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
Read a CSV table file into a matrix.
csvFileName | Name of the MediaWiki file. |
useHeader | (optional, default true) true: Insert the header rows of the CSV file into the matrix. false: Only transfer the table data. |
numHeaderRows | (optional, default 0) Number of rows interpreted as header rows. |
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
Read a Matlab file into a matrix.
matFileName | Name of the Matlab file. |
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
Read the header of a Matlab file.
matFileName | Name of the Matlab file. |
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
Read a MediaWiki table file into a matrix.
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. |
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
Read a raw photo image into a matrix.
rawImgFile | File name of the image. |
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
Read the header of a raw photo image.
rawImgFile | File name of the image. |
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
Read a Wikit table file into a matrix.
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. |
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
Set the position and size of a chart object.
chartObjId | Identifier of the chart object. |
rangeId | Identifier of the cell range. |
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
Save a workbook to an Excel file.
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. |
Save a workbook to an Excel file.
No return value.
See also: SaveAsCsv Close OpenWorkbook
Save a worksheet to file in CSV format.
workbookId | Identifier of the workbook containing the worksheet. |
worksheetId | Identifier of the worksheet to save. |
fileName | Name of the CSV file. |
Save a worksheet to file in CSV format.
No return value.
See also: SaveAs Close OpenWorkbook
Obsolete: Replaced with SaveChartObjAsImage in version 1.0.1
chartId | |
fileName | |
filterType | (optional, default GIF) |
Obsolete: Replaced with SaveChartObjAsImage in version 1.0.1
Save a chart as an image in a file.
chartObjId | Identifier of the chart object. |
fileName | Image file name. |
filterType | (optional, default GIF) Name of graphic filter. Possible values: GIF, JPEG, PNG. |
Save a chart as an image in a file.
No return value.
See also: ChartObjToClipboard CreateChart
Scale an image.
picId | Identifier of the image. |
scaleWidth | Horizontal scale factor. |
scaleHeight | Vertical scale factor. |
Scale an image.
The scale factors are floating point values. 1.0 means no scaling.
No return value.
See also: InsertImage
Find a string in a worksheet cell range.
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. |
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.
Select all cells of a worksheet.
worksheetId | Identifier of the worksheet. |
Select all cells of a worksheet.
Return the cells collection of the selected cells.
See also: CopyWorksheet
Select a cell by it's row/column index.
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. |
Select a cell by it's row/column index.
Return the identifier of the cell as a range identifier.
See also: SelectRangeByIndex AddWorksheet
Select a range by specifying a numeric cell range.
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. |
Select a range by specifying a numeric cell range.
Return the range identifier of the cell range.
See also: SelectCellByIndex GetCellRange
Select a range by specifying an Excel range string.
worksheetId | Identifier of the worksheet. |
rangeStr | String specifying a cell range. |
visSel | (optional, default false) true: See the selection in the user interface. false: The selection is not visible. |
Select a range by specifying an Excel range string.
Return the range identifier of the cell range.
See also: SelectRangeByIndex GetCellRange
Set the value of a cell.
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). |
Set the value of a cell.
The value to be inserted is interpreted either as string, integer or floating-point number according to the formats specified in "fmt" and "subFmt".
See also: GetCellValue SetRowValues SetMatrixValues
Set the maximum scale of an axis of a chart.
chartId | Identifier of the chart. |
axisName | Name of axis. Possible values: "x" or "y". |
value | Scale value. |
Set the maximum scale of an axis of a chart.
No return value.
See also: SetChartMinScale SetChartScale SetChartObjSize
Set the minimum scale of an axis of a chart.
chartId | Identifier of the chart. |
axisName | Name of axis. Possible values: "x" or "y". |
value | Scale value. |
Set the minimum scale of an axis of a chart.
No return value.
See also: SetChartMaxScale SetChartScale SetChartObjSize
Set the position of a chart object.
chartObjId | Identifier of the chart object. |
left | Left border of the chart object in pixel. |
top | Top border of the chart object in pixel. |
Set the position of a chart object.
No return value.
See also: PlaceChart SetChartObjSize SetChartScale
Set the size of a chart object.
chartObjId | Identifier of the chart object. |
width | Width of the chart object in pixel. |
height | Height of the chart object in pixel. |
Set the size of a chart object.
No return value.
See also: PlaceChart SetChartObjPosition SetChartScale
Set the minimum and maximum scale of both axes of a chart.
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. |
Set the minimum and maximum scale of both axes of a chart.
No return value.
See also: SetChartMinScale SetChartMaxScale SetChartObjSize
Obsolete: Replaced with SetChartObjSize in version 1.0.1
worksheetId | |
chartId | |
width | |
height |
Obsolete: Replaced with SetChartObjSize in version 1.0.1
Set the width of a range of columns.
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. |
Set the width of a range of columns.
No return value.
See also: SetColumnWidth ColumnCharToInt
Insert column values from a Tcl list.
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). |
Insert column values from a Tcl list.
No return value.
See also: GetColumnValues SetRowValues SetCellValue ColumnCharToInt
Set the width of a column.
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. |
Set the width of a column.
No return value.
See also: SetColumnsWidth ColumnCharToInt
Set the column separator character.
separatorChar | (optional, default ;) The character used as the column separator. |
Set the column separator character.
Insert row values from a Tcl list and format as a header row.
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. |
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
Insert a hyperlink into a worksheet.
worksheetId | Identifier of the worksheet where the hyperlink is inserted. |
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. |
Insert a hyperlink into a worksheet.
URL's are specified as strings. "file://myLinkedFile" specifies a link to a local file.
No return value.
See also: AddWorksheet
Insert matrix values into a worksheet.
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. |
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
Set the attributes of one border of a cell range.
rangeId | Identifier of the cell range. |
side | Value of enumeration type XlBordersIndex (see excelConst.tcl). Typical values: xlEdgeLeft, xlEdgeTop, xlEdgeBottom, xlEdgeRight. |
weight | (optional, default $::Excel::xlThin) Value of enumeration type XlBorderWeight (see excelConst.tcl). Typical values: xlThin, xlMedium, xlThick. |
lineStyle | (optional, default $::Excel::xlContinuous) Value of enumeration type XlLineStyle (see excelConst.tcl). Typical values: xlContinuous, xlDash, xlDot. |
r | (optional, default 0) Red component of the border color. |
g | (optional, default 0) Green component of the border color. |
b | (optional, default 0) Blue component of the border color. |
Set the attributes of one border of a cell range.
The r, g and b values are specified as integers in the range [0, 255].
No return value.
See also: SetRangeBorders SelectRangeByIndex SelectRangeByString
Set the attributes of all borders of a cell range.
rangeId | Identifier of the cell range. |
weight | (optional, default $::Excel::xlThin) Value of enumeration type XlBorderWeight (see excelConst.tcl). Typical values: xlThin, xlMedium, xlThick. |
lineStyle | (optional, default $::Excel::xlContinuous) Value of enumeration type XlLineStyle (see excelConst.tcl). Typical values: xlContinuous, xlDash, xlDot. |
r | (optional, default 0) Red component of the border color. |
g | (optional, default 0) Green component of the border color. |
b | (optional, default 0) Blue component of the border color. |
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
Set the fill color of a cell range.
rangeId | Identifier of the cell range. |
r | Red component of the text color. |
g | Green component of the text color. |
b | Blue component of the text color. |
Set the fill color of a cell range.
The r, g and b values are specified as integers in the range [0, 255].
No return value.
See also: SetRangeTextColor ::Cawt::RgbToColor SelectRangeByIndex SelectRangeByString
Set the bold font style of a cell range.
rangeId | Identifier of the cell range. |
onOff | (optional, default true) true: Set bold style on. false: Set bold style off. |
Set the bold font style of a cell range.
No return value.
See also: SetRangeFontItalic SelectRangeByIndex SelectRangeByString
Set the italic font style of a cell range.
rangeId | Identifier of the cell range. |
onOff | (optional, default true) true: Set italic style on. false: Set italic style off. |
Set the italic font style of a cell range.
No return value.
See also: SetRangeFontBold SelectRangeByIndex SelectRangeByString
Set the format of a cell range.
rangeId | Identifier of the cell range. |
fmt | Format of the cell range. Possible values: "text", "int", "real". |
subFmt | (optional, default ) Sub-format of the cell range. Only valid, if fmt is "real". Then it specifies the number of digits before and after the decimal point. Use the GetLangNumberFormat procedure for specifying the sub-format. If subFmt is the empty string 2 digits after the decimal point are used. |
Set the format of a cell range.
No return value.
See also: SelectRangeByIndex SelectRangeByString
Set the horizontal alignment of a cell range.
rangeId | Identifier of the cell range. |
align | Value of enumeration type XlHAlign (see excelConst.tcl). |
Set the horizontal alignment of a cell range.
No return value.
See also: SetRangeVerticalAlignment SelectRangeByIndex SelectRangeByString
Set the text color of a cell range.
rangeId | Identifier of the cell range. |
r | Red component of the text color. |
g | Green component of the text color. |
b | Blue component of the text color. |
Set the text color of a cell range.
The r, g and b values are specified as integers in the range [0, 255].
No return value.
See also: SetRangeFillColor ::Cawt::RgbToColor SelectRangeByIndex SelectRangeByString
Set the vertical alignment of a cell range.
rangeId | Identifier of the cell range. |
align | Value of enumeration type XlVAlign (see excelConst.tcl). |
Set the vertical alignment of a cell range.
No return value.
See also: SetRangeHorizontalAlignment SelectRangeByIndex SelectRangeByString
Insert row values from a Tcl list.
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). |
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
Insert header values into a tablelist.
tableId | |
headerList |
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
Insert matrix values into a tablelist.
tableId | |
matrixList |
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
Adjust a worksheet to fit onto given number of pages.
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. |
Adjust a worksheet to fit onto given number of pages.
When using the default values for wide and tall, the worksheet is adjusted to fit onto exactly one piece of paper.
No return value.
See also: AddWorksheet
Set the name of a worksheet.
worksheetId | Identifier of the worksheet. |
name | Name of the worksheet. |
Set the name of a worksheet.
No return value.
See also: GetWorksheetName AddWorksheet
Set the orientation of a worksheet.
worksheetId | Identifier of the worksheet. |
orientation | Value of enumeration type XlPageOrientation (see excelConst.tcl). Possible values: xlLandscape or xlPortrait. |
Set the orientation of a worksheet.
No return value.
See also: AddWorksheet
Set the zoom factor for printing of a worksheet.
worksheetId | Identifier of the worksheet. |
zoom | (optional, default 100) The zoom factor in percent as an integer value. |
Set the zoom factor for printing of a worksheet.
Valid zoom values are in the range [10, 400].
No return value.
See also: AddWorksheet
Show a cell identified by it's row/column index.
worksheetId | Identifier of the worksheet. |
row | Row number. Row numbering starts with 1. |
col | Column number. Column numbering starts with 1. |
Show a cell identified by it's row/column index.
Set the scrolling, so that the cell is show at the upper left corner.
See also: SelectCellByIndex
Insert the values of a tablelist into a worksheet.
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. |
Insert the values of a tablelist into a worksheet.
No return value.
See also: WorksheetToTablelist SetMatrixValues WikitFileToWorksheet MediaWikiFileToWorksheet MatlabFileToWorksheet RawImageFileToWorksheet WordTableToWorksheet
Toggle the AutoFilter switch of a cell range.
rangeId | Identifier of the cell range. |
Toggle the AutoFilter switch of a cell range.
No return value.
See also: SelectRangeByIndex SelectRangeByString
Toggle the visibilty of an Excel application window.
appId | Identifier of the Excel instance. |
visible | true: Show the application window. false: Hide the application window. |
Toggle the visibilty of an Excel application window.
No return value.
Convert a Wikit table file to an Excel file.
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. |
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
Insert the values of a Wikit table file into a worksheet.
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. |
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
Insert the values of a Word table into a worksheet.
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. |
Insert the values of a Word table into a worksheet.
No return value.
See also: WorksheetToWordTable SetMatrixValues WikitFileToWorksheet MediaWikiFileToWorksheet MatlabFileToWorksheet RawImageFileToWorksheet TablelistToWorksheet
Copy worksheet data into the clipboard.
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. |
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
Insert the values of a worksheet into a Matlab file.
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. |
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
Insert the values of a worksheet into a MediaWiki table file.
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. |
Insert the values of a worksheet into a MediaWiki table file.
No return value.
See also: MediaWikiFileToWorksheet GetMatrixValues WorksheetToWikitFile WorksheetToWordTable WorksheetToMatlabFile WorksheetToRawImageFile WorksheetToTablelist
Insert the values of a worksheet into a raw photo image file.
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. |
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
Insert the values of a worksheet into a tablelist.
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. |
Insert the values of a worksheet into a tablelist.
No return value.
See also: TablelistToWorksheet GetMatrixValues WorksheetToWikitFile WorksheetToMediaWikiFile WorksheetToMatlabFile WorksheetToRawImageFile WorksheetToWordTable
Insert the values of a worksheet into a Wikit table file.
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. |
Insert the values of a worksheet into a Wikit table file.
No return value.
See also: WikitFileToWorksheet GetMatrixValues WorksheetToMediaWikiFile WorksheetToWordTable WorksheetToMatlabFile WorksheetToRawImageFile WorksheetToTablelist
Insert the values of a worksheet into a Word table.
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. |
Insert the values of a worksheet into a Word table.
No return value.
See also: WordTableToWorksheet GetMatrixValues WorksheetToWikitFile WorksheetToMediaWikiFile WorksheetToMatlabFile WorksheetToRawImageFile WorksheetToTablelist
Write the values of a matrix into a CSV file.
matrixList | Matrix with table data. |
csvFileName | Name of the CSV file. |
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
Write the values of a matrix into a Matlab file.
matrixList | Floating point matrix. |
matFileName | Name of the Matlab file. |
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
Write the values of a matrix into a MediaWiki table file.
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. |
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
Write the values of a matrix into a raw photo image file.
matrixList | Floating point matrix. |
rawImgFile | File name of the image. |
Write the values of a matrix into a raw photo image file.
Note: The matrix values are written as a 1-channel floating-point image.
See SetMatrixValues for the description of a matrix representation.
No return value.
See also: ReadRawImageFile WorksheetToRawImageFile
Write the values of a matrix into a Wikit table file.
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. |
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
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
Toggle the fullscreen mode of an Internet Explorer application window.
appId | Identifier of the Internet Explorer instance. |
onOff | true: Use fullscreen mode. false: Use windowed mode. |
Toggle the fullscreen mode of an Internet Explorer application window.
No return value.
Go to a specific page.
appId | Identifier of the Internet Explorer instance. |
target | String identifying the target page. |
Go to a specific page.
Possible values for target are: "Back", "Forward", "Home", "Search"
No return value.
Check, if an Internet Explorer instance is busy.
appId | Identifier of the Internet Explorer instance. |
Check, if an Internet Explorer instance is busy.
Return true or false dependent on the busy status.
Navigate to a URL or local file.
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. |
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.
Open an Internet Explorer instance. Use an already running Internet Explorer, if available.
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. |
Open an Internet Explorer instance. Use an already running Internet Explorer, if available.
Return the identifier of the Internet Explorer application instance.
See also: OpenNew Quit Visible
Open a new Internet Explorer instance.
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. |
Open a new Internet Explorer instance.
Return the identifier of the new Internet Explorer application instance.
Quit a Internet Explorer application instance.
appId | Identifier of the Internet Explorer instance. |
Quit a Internet Explorer application instance.
No return value.
See also: Open
Toggle the visibilty of an Internet Explorer application window.
appId | Identifier of the Internet Explorer instance. |
visible | true: Show the application window. false: Hide the application window. |
Toggle the visibilty of an Internet Explorer application window.
No return value.
The Matlab namespace provides commands to control MathWorks Matlab.
Execute a Matlab command.
appId | Identifier of the Matlab instance. |
cmd | String containg the Matlab command being executed. |
Execute a Matlab command.
Return the Matlab answer as a string.
Open a Matlab instance. Use an already running Matlab, if available.
visible | (optional, default true) true: Show the application window. false: Hide the application window. |
Open a Matlab instance. Use an already running Matlab, if available.
Return the identifier of the Matlab application instance.
See also: OpenNew Visible Quit
Open a new Matlab instance.
visible | (optional, default true) true: Show the application window. false: Hide the application window. |
Open a new Matlab instance.
Return the identifier of the new Matlab application instance.
Quit a Matlab application instance.
appId | Identifier of the Matlab instance. |
Quit a Matlab application instance.
No return value.
See also: Open
Toggle the visibilty of a Matlab application window.
appId | Identifier of the Matlab instance. |
visible | true: Show the application window. false: Hide the application window. |
Toggle the visibilty of a Matlab application window.
No return value.
The Ocr namespace provides commands to control Microsoft Document Imaging.
Close an OCR document instance.
docId | Identifier of the OCR document. |
Close an OCR document instance.
No return value.
See also: Open
Return the recognized text of a OCR layout.
layoutId | Identifier of the OCR layout. |
Return the recognized text of a OCR layout.
See also: Scan
Return the number of images of an OCR document.
docId | Identifier of the OCR document. |
Return the number of images of an OCR document.
See also: OpenDocument Scan
Return the number of words identified in an OCR document.
layoutId | Identifier of the OCR layout. |
Return the number of words identified in an OCR document.
See also: GetFullText GetNumImages Scan
Return the text of a recognized word.
layoutId | Identifier of the OCR layout. |
wordNum | Index number of the word (starting at zero). |
Return the text of a recognized word.
See also: GetFullText GetNumWords Scan
Return statistics of a recognized word.
layoutId | Identifier of the OCR layout. |
wordNum | Index number of the word (starting at zero). |
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 an OCR document instance.
Open an OCR document instance.
Return the OCR document identifier.
See also: OpenDocument Close
Open an image file for OCR scanning.
docId | OCR document identifier. |
fileName | Image to be scanned. Must be in TIFF or BMP format. |
Open an image file for OCR scanning.
No return value.
Scan an image.
docId | Identifier of the OCR document. |
imgNum | (optional, default 0) Image number to be scanned. |
Scan an image.
Return the layout identifier of the scanned image.
See also: OpenDocument GetNumImages
The Ppt namespace provides commands to control Microsoft PowerPoint.
Add a new empty presentation.
appId | Identifier of the PowerPoint instance. |
Add a new empty presentation.
Return the identifier of the new presentation.
See also: OpenPres GetActivePres
Add a new slide to a presentation.
presId | Identifier of the presentation. |
type | (optional, default $::Ppt::ppLayoutBlank) Value of enumeration type PpSlideLayout (see pptConst.tcl). |
slideIndex | (optional, default -1) Insertion index of new slide. If negative, insert slide at the end. |
Add a new slide to a presentation.
Return the identifier of the new slide.
See also: CopySlide
Close a presentation without saving changes.
presId | Identifier of the presentation to close. |
Close a presentation without saving changes.
Use the SaveAs method before closing, if you want to save changes.
No return value.
Close all presentations of a PowerPoint instance.
appId | Identifier of the PowerPoint instance. |
Close all presentations of a PowerPoint instance.
Use the SaveAs method before closing, if you want to save changes.
No return value.
Copy the contents of a slide into another slide.
presId | Identifier of the presentation. |
fromSlideIndex | Index of source slide. |
toSlideIndex | (optional, default -1) Insertion index of copied slide. If negative, insert slide at the end. |
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
Exit specified slide show.
slideShowId | Identifier of the slide show as returned by UseSlideShow. |
Exit specified slide show.
No return value.
See also: GetNumSlideShows UseSlideShow SlideShowNext
Export a PowerPoint file to an image sequence.
pptFile | Name of the PowerPoint file (as absolute path). |
outputDir | Name of the output folder (as absolute path). |
outputFileFmt | Name of the output file names (printf style with 1 "%d" for the slide index). |
startIndex | (optional, default 1) Start index for slide export. |
endIndex | (optional, default end) End index for slide export. |
imgType | (optional, default GIF) Name of the image format filter. This is the name as stored in the Windows registry. Ex: "GIF", "PNG". |
width | (optional, default -1) Width of the generated images in pixels. |
height | (optional, default -1) Height of the generated images in pixels. |
useMaster | (optional, default true) true: Export with the contents of the master slide. false: Do not export the contents of the master slide. |
genHtmlTable | (optional, default true) Additionally generate a HTML table with preview images. |
thumbsPerRow | (optional, default 4) Number of preview images per HTML table row. |
thumbSize | (optional, default 150) Maximum size of the preview images in pixels. |
Export a PowerPoint file to an image sequence.
If the output directory does not exist, it is created. Caution: All existing files in the output directory are deleted before exporting.
If width and height are not specified or less than zero, the default sizes of PowerPoint are used.
No return value.
See also: ExportSlide ExportSlides
Export a slide as an image.
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. |
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
Export a range of slides as image files.
presId | Identifier of the presentation. |
outputDir | Name of the output folder (as absolute path). |
outputFileFmt | Name of the output file names (C printf style with one "%d" for the slide index). |
startIndex | (optional, default 1) Start index for slide export. |
endIndex | (optional, default end) End index for slide export. |
imgType | (optional, default GIF) Name of the image format filter. This is the name as stored in the Windows registry. Ex: "GIF", "PNG". |
width | (optional, default -1) Width of the generated images in pixels. |
height | (optional, default -1) Height of the generated images in pixels. |
Export a range of slides as image files.
If the output directory does not exist, it is created. If width and height are not specified or less than zero, the default sizes of PowerPoint are used.
No return value. If the export failed, an error is thrown.
See also: ExportPptFile ExportSlide
Return the active presentation of an application.
appId | Identifier of the PowerPoint instance. |
Return the active presentation of an application.
Return the identifier of the active presentation.
Return the default extension of a PowerPoint file.
appId | Identifier of the PowerPoint instance. |
Return the default extension of a PowerPoint file.
Starting with PowerPoint 12 (2007) this is the string ".pptx". In previous versions it was ".ppt".
Return the number of slides of a presentation.
presId | Identifier of the presentation. |
Return the number of slides of a presentation.
See also: GetNumSlideShows
Return the number of slide shows of a presentation.
appId | Identifier of the PowerPoint instance. |
Return the number of slide shows of a presentation.
See also: GetNumSlides UseSlideShow ExitSlideShow
Get slide identifier form slide index.
presId | Identifier of the presentation. |
slideIndex | Index of slide. Slide indices start at 1. |
Get slide identifier form slide index.
Return the identifier of the slide.
Return the index of a slide.
slideId | Identifier of the slide. |
Return the index of a slide.
See also: GetNumSlides AddSlide
Return the version of a PowerPoint application.
appId | Identifier of the Excel instance. |
useString | (optional, default false) true: Return the version name (ex. "PowerPoint 2003"). false: Return the version number (ex. "11.0"). |
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.
Return the view type of a presentation.
presId | Identifier of the presentation. |
Return the view type of a presentation.
See also: SetViewType
Insert an image into a slide.
slideId | Identifier of the slide where the image is inserted. |
imgFileName | File name of the image (as absolute path). |
left | X position of top-left image position in points. |
top | Y position of top-left image position in points. |
width | (optional, default -1) Width of image in points. |
height | (optional, default -1) Height of image in points. |
Insert an image into a slide.
The file name of the image must be an absolute pathname. Use a construct like [file join [pwd] "myImage.gif"] to insert images from the current directory.
Return the identifier of the inserted image.
See also: ::Cawt::InchesToPoints ::Cawt::CentiMetersToPoints
Open a PowerPoint instance. Use an already running PowerPoint, if available.
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. |
Open a PowerPoint instance. Use an already running PowerPoint, if available.
Return the identifier of the PowerPoint application instance.
Open a new PowerPoint instance.
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. |
Open a new PowerPoint instance.
Return the identifier of the new PowerPoint application instance.
Open a presentation, i.e load a PowerPoint file.
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. |
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 a PowerPoint application instance.
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. |
Quit a PowerPoint application instance.
No return value.
See also: Open
Save a presentation to a PowerPoint file.
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. |
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
Set the view type of a presentation.
presId | Identifier of the presentation. |
viewType | Value of enumeration type PpViewType (see pptConst.tcl). |
Set the view type of a presentation.
No return value.
See also: GetViewType
Show a specific slide.
presId | Identifier of the presentation. |
slideIndex | Index of slide. Slide indices start at 1. |
Show a specific slide.
No return value.
Goto first slide in slide show.
slideShowId | Identifier of the slide show. |
Goto first slide in slide show.
No return value.
See also: UseSlideShow SlideShowNext SlideShowPrev SlideShowLast
Goto last slide in slide show.
slideShowId | Identifier of the slide show. |
Goto last slide in slide show.
No return value.
See also: UseSlideShow SlideShowNext SlideShowPrev SlideShowFirst
Goto next slide in slide show.
slideShowId | Identifier of the slide show. |
Goto next slide in slide show.
No return value.
See also: UseSlideShow SlideShowPrev SlideShowFirst SlideShowLast
Goto previous slide in slide show.
slideShowId | Identifier of the slide show. |
Goto previous slide in slide show.
No return value.
See also: UseSlideShow SlideShowNext SlideShowFirst SlideShowLast
Use specified slide show.
presId | Identifier of the presentation. |
slideShowIndex | Index of the slide show. Indices start at 1. |
Use specified slide show.
Return the identifier of the specified slide show.
See also: GetNumSlides ExitSlideShow SlideShowNext
Toggle the visibilty of a PowerPoint application window.
appId | Identifier of the PowerPoint instance. |
visible | true: Show the application window. false: Hide the application window. |
Toggle the visibilty of a PowerPoint application window.
No return value.
The Word namespace provides commands to control Microsoft Word.
Add a new empty document to a Word instance.
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. |
Add a new empty document to a Word instance.
Return the identifier of the new document.
See also: OpenDocument
Add a new paragraph to a document.
rangeId | Identifier of the text range. |
where | (optional, default after) Insertion point of the new paragraph. |
Add a new paragraph to a document.
No return value.
See also: AppendParagraph
Add a new row to a table.
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. |
Add a new row to a table.
No return value.
See also: GetNumRows
Add a new table in a text range.
docId | Identifier of the document. |
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. |
Add a new table in a text range.
Return the identifier of the new table.
See also: GetNumRows GetNumColumns
Append a paragraph at the end of the document.
docId | Identifier of the document. |
text | (optional, default ) Appended text string. |
spaceAfter | (optional, default -1) |
Append a paragraph at the end of the document.
Append a new paragraph to the end of the document and (optionally) insert a text string in the new paragraph.
Return the new end range.
See also: AddParagraph
Append text to a Word document.
docId | Identifier of the document. |
text | Appended text string. |
Append text to a Word document.
The text string is appended at the current end range of the document.
See also:
Close a document without saving changes.
docId | Identifier of the document. |
Close a document without saving changes.
Use the SaveAs method before closing, if you want to save changes.
No return value.
See also: SaveAs
Extend the range indices of a text range.
docId | Identifier of the document. |
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. |
Extend the range indices of a text range.
Increment is either an integer value or strings "begin" or "end" to use the start or end of the document.
Return the new extended range.
See also: SetRangeBeginIndex SetRangeEndIndex
Find a string in a text range.
rangeId | Identifier of the text range. |
str | Search string. |
matchCase | (optional, default true) Flag indicating case sensitive search. |
Find a string in a text range.
Return true, if string was found. Otherwise false. If the string was found, the selection is set to the found string.
See also: ReplaceString GetSelectionRange
Format a row as a header row.
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. |
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
Return a cell of a Word table as a range.
tableId | Identifier of the Word table. |
row | Row number. Row numbering starts with 1. |
col | Column number. Column numbering starts with 1. |
Return a cell of a Word table as a range.
Return a range consisting of 1 cell of a Word table.
See also: GetRowRange GetColumnRange
Return the value of a Word table cell.
tableId | Identifier of the Word table. |
row | Row number. Row numbering starts with 1. |
col | Column number. Column numbering starts with 1. |
Return the value of a Word table cell.
Return the value of the specified cell as a string.
See also: SetCellValue
Return a column of a Word table as a selection.
tableId | Identifier of the Word table. |
col | Column number. Column numbering starts with 1. |
Return a column of a Word table as a selection.
Return a selection consisting of all cells of a column. Note, that a selection is returned and not a range, because columns do not have a range property.
See also: GetCellRange GetRowRange
Return column values of a Word table as a Tcl list.
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 column values of a Word table as a Tcl list.
Return the values of the specified column or column range as a Tcl list.
See also: SetColumnValues GetRowValues GetCellValue
Find a document by it's index.
appId | Identifier of the Word instance. |
index | Index of the document to find. |
Find a document by it's index.
Return the identifier of the found document. If the index is out of bounds an error is thrown.
See also: GetNumDocuments GetDocumentName
Get the name of a document.
docId | Identifier of the document. |
Get the name of a document.
Return the name of the document (i.e. the full path name of the corresponding Word file) as a string.
Return the text range representing the end of the document.
docId | Identifier of the document. |
Return the text range representing the end of the document.
Note: This corresponds to the built-in bookmark \endofdoc.
See also: GetSelectionRange GetStartRange
Return the default extension of a Word file.
appId | Identifier of the Word instance. |
Return the default extension of a Word file.
Starting with Word 12 (2007) this is the string ".docx". In previous versions it was ".doc".
Return table values as a matrix.
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 table values as a matrix.
See also: SetMatrixValues
Return the number of columns of a Word tablee.
tableId | Identifier of the Word table. |
Return the number of columns of a Word tablee.
See also: GetNumRows
Return the number of documents in a Word application.
appId | Identifier of the Word instance. |
Return the number of documents in a Word application.
See also: AddDocument OpenDocument
Return the number of rows of a Word tablee.
tableId | Identifier of the Word table. |
Return the number of rows of a Word tablee.
See also: GetNumColumns
Return the number of tables of a Word document.
docId | Identifier of the document. |
Return the number of tables of a Word document.
See also: AddTable GetNumRows GetNumCols
Return the end index of a text range.
rangeId | Identifier of the text range. |
Return the end index of a text range.
See also: GetRangeStartIndex PrintRange
Return the start index of a text range.
rangeId | Identifier of the text range. |
Return the start index of a text range.
See also: GetRangeEndIndex PrintRange
Return a row of a Word table as a range.
tableId | Identifier of the Word table. |
row | Row number. Row numbering starts with 1. |
Return a row of a Word table as a range.
Return a range consisting of all cells of a row.
See also: GetCellRange GetColumnRange
Return row values of a Word table as a Tcl list.
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 row values of a Word table as a Tcl list.
Return the values of the specified row or row range as a Tcl list.
See also: SetRowValues GetColumnValues GetCellValue
Return the text range representing the current selection.
docId | Identifier of the document. |
Return the text range representing the current selection.
See also: GetStartRange GetEndRange
Return the text range representing the start of the document.
docId | Identifier of the document. |
Return the text range representing the start of the document.
See also: GetSelectionRange GetEndRange
Find a table by it's index.
docId | Identifier of the document. |
index | Index of the table to find. |
Find a table by it's index.
Return the identifier of the found table. If the index is out of bounds an error is thrown.
See also: GetNumTables
Return the version of a Word application.
appId | Identifier of the Word instance. |
useString | (optional, default false) true: Return the version name (ex. "Word 2000"). false: Return the version number (ex. "9.0"). |
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.
Insert an image into a range of a document.
rangeId | Identifier of the text range. |
imgFileName | File name of the image (as absolute path). |
linkToFile | (optional, default false) Insert a link to the image instead of a copy. |
saveWithDocument | (optional, default false) If using a link, store the image in the file, too. |
Insert an image into a range of a document.
The file name of the image must be an absolute pathname. Use a construct like [file join [pwd] "myImage.gif"] to insert images from the current directory.
Return the identifier of the inserted image.
Open a Word instance. Use an already running Word, if available.
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. |
Open a Word instance. Use an already running Word, if available.
Return the identifier of the Word application instance.
See also: OpenNew Quit Visible
Open a document, i.e load a Word file.
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. |
Open a document, i.e load a Word file.
Return the identifier of the opened document. If the document was already open, activate that document and return the identifier to that document.
See also: AddDocument
Open a new Word instance.
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. |
Open a new Word instance.
Return the identifier of the new Word application instance.
Print the indices of a text range.
rangeId | Identifier of the text range. |
msg | (optional, default Range: ) String printed in front of the indices. |
Print the indices of a text range.
The range identifiers are printed onto standard output.
No return value.
See also: GetRangeStartIndex GetRangeEndIndex
Quit a Word application instance.
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. |
Quit a Word application instance.
No return value.
Replace a string in a text range. Generic case.
rangeId | Identifier of the text range. |
str | Search string. |
func | Replacement procedure. |
args | Arguments for replacement procedure. |
Replace a string in a text range. Generic case.
Search for string "str" in the range "rangeId". For each occurence found, call procedure "func" with the range of the found occurence and additional parameters specified in "args". The procedures which can be used for "func" must therefore have the following signature: proc SetRangeXYZ rangeId param1 param2 ... See example Word-04-Find.tcl for an example.
No return value.
See also: SearchString ReplaceString
Replace a string in a text range. Simple case.
rangeId | Identifier of the text range. |
searchStr | Search string. |
replaceStr | Replacement string. |
howMuch | (optional, default one) "one" to replace first occurence only. "all" to replace all occurences. |
matchCase | (optional, default true) Flag indicating case sensitive search. |
Replace a string in a text range. Simple case.
Return true, if string could be replaced, i.e. the search string was found. Otherwise false.
See also: SearchString ReplaceByProc
Save a document to a Word file.
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. |
Save a document to a Word file.
No return value.
Set the value of a Word table cell.
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. |
Set the value of a Word table cell.
See also: GetCellValue SetRowValues SetMatrixValues
Set the width of a range of table columns.
tableId | Identifier of the Word table. |
startCol | Range start column number. Column numbering starts with 1. |
endCol | Range end column number. Column numbering starts with 1. |
width | Column width of table column in points. |
Set the width of a range of table columns.
No return value.
See also: SetColumnWidth InchesToPoints
Insert column values into a Word table.
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). |
Insert column values into a Word table.
No return value.
See also: GetColumnValues SetRowValues SetCellValue
Set the width of a table column.
tableId | Identifier of the Word table. |
col | Column number. Column numbering starts with 1. |
width | Column width of table column in points. |
Set the width of a table column.
No return value.
See also: SetColumnsWidth InchesToPoints
Set the compatibility mode of a document.
docId | Identifier of the document. |
mode | (optional, default $::Word::wdWord2010) Compatibility mode of the document. Value of enumeration type WdCompatibilityMode (see wordConst.tcl). |
Set the compatibility mode of a document.
Available only for Word 2010 and up.
No return value.
Insert row values into a Word table and format as a header row.
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. |
Insert row values into a Word table and format as a header row.
No return value. If headerList is an empty list, an error is thrown.
See also: SetRowValues FormatHeaderRow
Insert a hyperlink into a Word document.
docId | Identifier of the document. |
rangeId | Identifier of the text range. |
link | URL of the hyperlink. |
textDisplay | (optional, default ) Text to be displayed instead of the URL. |
Insert a hyperlink into a Word document.
URL's are specified as strings. "file://myLinkedFile" specifies a link to a local file.
No return value.
Insert matrix values into a Word table.
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. |
Insert matrix values into a Word table.
The matrix data must be stored as a list of lists. Each sub-list contains the values for the row values. The main (outer) list contains the rows of the matrix. Example: { { R1_C1 R1_C2 R1_C3 } { R2_C1 R2_C2 R2_C3 } }
No return value.
See also: GetMatrixValues
Set the background color of a text range.
rangeId | Identifier of the text range. |
r | Red component of the text color. |
g | Green component of the text color. |
b | Blue component of the text color. |
Set the background color of a text range.
The r, g and b values are specified as integers in the range [0, 255].
No return value.
See also: SetRangeBackgroundColorByEnum SetRangeHighlightColorByEnum
Set the background color of a text range.
rangeId | Identifier of the text range. |
colorEnum | Value of enumeration type WdColor (see wordConst.tcl). |
Set the background color of a text range.
No return value.
See also: SetRangeBackgroundColor SetRangeHighlightColorByEnum
Set the end index of a text range.
docId | Identifier of the document. |
rangeId | Identifier of the text range. |
index | Index for the range end. |
Set the end index of a text range.
Index is either an integer value or string "end" to use the end of the document.
No return value.
See also: SetRangeBeginIndex GetRangeEndIndex
Toggle the bold font style of a text range.
rangeId | Identifier of the text range. |
onOff | (optional, default true) true: Set bold style on. false: Set bold style off. |
Toggle the bold font style of a text range.
No return value.
See also: SetRangeFontItalic
Toggle the italic font style of a text range.
rangeId | Identifier of the text range. |
onOff | (optional, default true) true: Set italic style on. false: Set italic style off. |
Toggle the italic font style of a text range.
No return value.
See also: SetRangeFontBold
Set the highlight color of a text range.
rangeId | Identifier of the text range. |
colorEnum | Value of enumeration type WdColor (see wordConst.tcl). |
Set the highlight color of a text range.
No return value.
See also: SetRangeBackgroundColorByEnum
Set the horizontal alignment of a text range.
rangeId | Identifier of the text range. |
align | Value of enumeration type WdParagraphAlignment (see wordConst.tcl). |
Set the horizontal alignment of a text range.
No return value.
See also: SetRangeHighlightColorByEnum
Set the start index of a text range.
docId | Identifier of the document. |
rangeId | Identifier of the text range. |
index | Index for the range start. |
Set the start index of a text range.
Index is either an integer value or string "begin" to use the start of the document.
No return value.
See also: SetRangeEndIndex GetRangeStartIndex
Insert row values from a Tcl list.
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). |
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
Set the border line styles of a Word table.
tableId | Identifier of the Word table. |
outsideLineStyle | (optional, default -1) Outside border style. |
insideLineStyle | (optional, default -1) Inside border style. |
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
Set the border line widths of a Word table.
tableId | Identifier of the Word table. |
outsideLineWidth | (optional, default -1) Outside border line width. |
insideLineWidth | (optional, default -1) Inside border line width. |
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
Trim a string.
str | String to be trimmed. |
Trim a string.
The string is trimmed from the left and right side. Trimmed characters are: Whitespaces, BEL (0x7) and CR (0xD).
Return the trimmed string.
Toggle the visibilty of a Word application window.
appId | Identifier of the Word instance. |
visible | true: Show the application window. false: Hide the application window. |
Toggle the visibilty of a Word application window.
No return value.