CAWT - COM Automation With Tcl
2.1 CawtCore: Basic automation functionality
2.2 CawtOffice: Basic Microsoft Office automation functionality
2.3 CawtEarth: Automation for Google Earth
2.4 CawtExcel: Automation for Microsoft Excel
2.5 CawtExplorer: Automation for Internet Explorer
2.6 CawtMatlab: Automation for MathWorks Matlab
2.7 CawtOcr: Automation for Microsoft Document Imaging
2.8 CawtOneNote: Automation for Microsoft OneNote
2.9 CawtOutlook: Automation for Microsoft Outlook
2.10 CawtPpt: Automation for Microsoft PowerPoint
2.11 CawtReader: Automation for Acrobat Reader
2.12 CawtSapi: Automation for Microsoft Speech API
2.13 CawtWord: Automation for Microsoft Word
3 Miscellaneous CAWT information
4.1 Application EnumExplorer.tcl
4.2 Application OneNoteInfo.tcl
4.4 Application WordAbbrCheck.tcl
8.3 Table of Terms and Abbreviations
This document describes CAWT version 3.1.1.
CAWT is a high-level Tcl interface for scripting Microsoft Windows® applications having a COM interface. It uses Twapi for automation via the COM interface.
Currently packages for Microsoft Excel, Word, PowerPoint, OneNote, Outlook, SAPI, Internet Explorer, MathWorks Matlab, Adobe Acrobat Reader and Google Earth are available.
Note: Only Microsoft Office packages Excel, Word, PowerPoint and Outlook are in active development. The other packages are proof-of-concept examples only.
CAWT sources are available at https://sourceforge.net/projects/cawt/.
The CAWT homepage is at https://www.tcl3d.org/cawt/
The CAWT user distribution contains the Tcl sources, documentation (this document and a reference manual) and several test programs showing the use of the CAWT functionality.
The CAWT developer distribution additionally contains scripts for generating the documentation and the distribution packages. Documentation generation needs packages Ruff! and textutil (see chapter 1.2 Dependencies for details). The developer distribution is intended for programmers who want to extend the CAWT package.
The CAWT package currently consists of the following sub-packages:
CawtCore |
Basic automation functionality. |
CawtOffice |
Basic Microsoft Office automation functionality. |
|
|
CawtEarth |
Automation functionality for Google Earth. |
CawtExcel |
Automation functionality for Microsoft Excel. |
CawtExplorer |
Automation functionality for Microsoft Internet Explorer. |
CawtMatlab |
Automation functionality for MathWorks Matlab. |
CawtOcr |
Automation functionality for Microsoft Document Imaging. |
CawtOneNote |
Automation functionality for Microsoft OneNote |
CawtOutlook |
Automation functionality for Microsoft Outlook. |
CawtPpt |
Automation functionality for Microsoft PowerPoint. |
CawtReader |
Automation functionality for Adobe Acrobat Reader. |
CawtSapi |
Automation functionality for Microsoft Speech API. |
CawtWord |
Automation functionality for Microsoft Word. |
Each sub-package is implemented as a separate Tcl package and can be loaded explicitly with the Tcl package command, ex. package require cawtexcel. All available CAWT sub-packages can be loaded with a single command: package require cawt.
Note: Package names are all lower case.
The next figure shows the architecture of the CAWT package.
Figure 1: Overview of CAWT packages
The following table shows a list of the external Tcl packages used in the CAWT infrastructure.
Lib |
Version |
Comment |
URL |
Libraries needed for the CAWT package |
|||
Twapi |
>= 4.4 |
Mandatory. |
|
tDOM |
>= 0.9 |
Optional. See Notes below. |
|
TkImg |
>= 1.4.1 |
Optional. See Notes below. |
|
Tablelist |
>= 6 |
Optional. See Notes below. |
|
Libraries needed for generating the CAWT documentation |
|||
Ruff! |
>= 1.0 |
Optional. |
|
tcllib |
>= 1.22 |
Optional. |
Note:
Twapi Need Twapi >= 5 for Tcl 9.
tDOM Mandatory for the CawtOneNote package.
TkImg: Needed for some functionalities (see the CawtExcel package for further details).
Tablelist: Needed only for the excelTablelist module.
Note:
CAWT and the above listed dependencies are available via the BAWT (Build Automation With Tcl) Tcl-BI distribution at https://www.tcl3d.org/bawt/
Installation of CAWT is simple and fast.
Check, if all of the dependencies listed in the previous chapter are available.
If you just want to play with the test programs to get an impression on how CAWT works, unzip the user distribution file in a folder of your choice. Then open a shell window, go to folder TestPrograms of the CAWT distribution and execute a test program with a line as follows:
> tclsh Excel-01_Basic.tcl
See also chapter 5.2 Test execution for scripts to run all or groups of test programs in batch mode.
If you want to use CAWT as a package for your own applications, the Cawt folder should be copied into the library section of your Tcl installation (ex. C:\Tcl\lib). If write access to this Tcl directory is not permitted, you can copy the Cawt directory somewhere else, eg. C:\myCawt. To have Tcl look for packages in this location, you must set the TCLLIBPATH environment variable with the above specified directory name as value. Note that on Windows the path must be written with slashes (not backslashes):
> set TCLLIBPATH = C:/myCawt.
This chapter explains the different packages of CAWT.
For a detailed description of the available procedures in the different sub-packages see the CAWT reference manual available at the CAWT homepage or in the distribution.
The procedures of package CawtCore are implemented in namespace Cawt.
They provide functionality for the following domains:
Domain |
Examples |
Package information |
HavePkg, GetPkgVersion |
Conversion functionality |
CentiMetersToPoints, TclBool |
COM access via Twapi |
GetOrCreateApp, IsValidId, Destroy |
Application embedding |
EmbedApp, SetEmbedTimeout |
Event handling |
SetEventCallback |
Color handling |
GetColor, GetColorNames, RgbToOfficeColor |
Interpolation handling |
oo::class Interpolate |
Image utilities |
ClipboardToImg, ImgToClipboard |
Date utilities |
XmlDateToIsoDate, OutlookDateToSeconds |
String utilities |
CountWords |
Testing utilities |
CheckString, CheckNumber, CheckMatrix |
The following table lists all procedures available in namespace Cawt.
CawtCore Procedure |
Short description |
Convert centimeter value into points. |
|
Check, if two boolean values are identical. |
|
Check, if the number of COM objects fits expected value. |
|
Check, if two files are identical. |
|
Check, if two lists are identical. |
|
Check, if two matrices are identical. |
|
Check, if two numerical values are identical. |
|
Check, if two string values are identical. |
|
N/A |
|
Copy the clipboard content into a photo image. |
|
Concatenates files into one file. |
|
Count words contained in a string. |
|
Destroy one or all COM objects. |
|
Embed an application into a Tk frame. |
|
Convert a color representation into an Office color number. |
|
Get all supported Tcl color names. |
|
Get the COM objects currently in use as a list. |
|
Get the dots-per-inch value used for conversions. |
|
Get the number of COM objects currently in use. |
|
Use or create an instance of an application. |
|
Get the version of a CAWT sub-package. |
|
Get path to program for a given file extension. |
|
Try different environment variables. |
|
Check, if a CAWT sub-package is available. |
|
Copy a photo image into the clipboard. |
|
Convert inch value into points. |
|
Check, if an application identifier is valid. |
|
Check, if parameter is a COM object. |
|
Check, if specified color is a valid Tcl hexadecimal color string. |
|
Check, if specified color is a valid Tcl color name. |
|
Return ISO date string as Office date. |
|
Return ISO date string as seconds. |
|
Return ISO date string as XML date string. |
|
Check, if specified color is a valid Office color number. |
|
Check, if specified color is a valid RGB representation. |
|
Check, if a file is encoded in Unicode. |
|
Check, if supplied address is a valid URL. |
|
Kill all running instances of an application. |
|
Convert an Office color number into a RGB color list. |
|
Return Office date as ISO date string. |
|
Return Office date as seconds. |
|
Convert value in points into centimeters. |
|
Convert value in points into inches. |
|
Pop last entry from COM objects stack. |
|
Print the number of currently available COM objects to stdout. |
|
Push current list of COM objects onto a stack. |
|
Convert a RGB color into an Office color number. |
|
Return date in seconds as ISO date string. |
|
Return date in seconds as Office date. |
|
Return date in seconds as XML date string. |
|
Set the time to wait until clipboard content is ready. |
|
Set the dots-per-inch value used for conversions. |
|
Set the timeout to wait for the embedded application to start. |
|
Set an event callback procedure. |
|
Split a file into several output files. |
|
Cast a value to a boolean. |
|
Cast a value to an integer with boolean range. |
|
Cast a value to a string. |
|
Convert a value into points. |
|
Wait until clipboard content is ready. |
|
Return XML date string as ISO date string. |
|
Return XML date string as seconds. |
Table 1: CawtCore Reference
The procedures of package CawtOffice are implemented in namespace Office.
They provide functionality for the following domains:
Domain |
Examples |
Office application functionality |
GetApplicationName, GetApplicationId |
Office document properties |
SetDocumentProperty, GetDocumentProperty |
Office environment |
GetUserName, GetUserPath, GetActivePrinter |
Office macros |
AddMacro, RunMacro |
Namespace Office has an internal namespace Enum with procedures for all enumeration types of this package. The procedure names correspond to the name of the enumeration type and return a list of enumeration names and values. See the reference manual for a list of all enumeration types.
Example:
proc MsoBarRow {} {
# msoBarRowFirst - 0
# msoBarRowLast - -1
return { msoBarRowFirst 0 msoBarRowLast -1 }
}
The following table lists all procedures available in namespace Office.
CawtOffice Procedure |
Short description |
Add macros or functions to an Office document. |
|
Add a custom document property. |
|
Delete a document property. |
|
Get the name of the active printer. |
|
Get the application identifier of an Office object. |
|
Get the name of an Office application. |
|
Get the version number of an Office application. |
|
Get document property names as a list. |
|
Get the value of a document property. |
|
Get numeric value of an enumeration. |
|
Get name of a given enumeration type and numeric value. |
|
Get names of a given enumeration type. |
|
Get available enumeration types. |
|
Get numeric value of an enumeration name. |
|
Get the Office installation pathname. |
|
Get the Office type of a file. |
|
Get a document property. |
|
Get the name of a document property. |
|
Get the type of a document property. |
|
Get the value of a document property. |
|
Get the Office startup pathname. |
|
Get the Office templates pathname. |
|
Get the Office user library pathname. |
|
Get the name of the Office application user. |
|
Get the Office user folder's pathname. |
|
Check, if Office object is an application identifier. |
|
Run a macro or function contained in an Office document. |
|
Set the value of a document property. |
|
Enable or disable printer communication. |
|
Set the value of a document property. |
Table 2: CawtOffice Reference
The name of the controlled application is GoogleEarth.ApplicationGE.
The procedures of package CawtEarth are implemented in namespace Earth.
They provide functionality for the following domains:
Domain |
Examples |
Application handling |
Open, Quit |
Camera positioning |
SetCamera |
See the test programs Earth-*.tcl for examples on how to use the procedures of this package.
The following table lists all procedures available in namespace Earth.
CawtEarth Procedure |
Short description |
Check, if a GoogleEarth instance is initialized. |
|
Open a GoogleEarth instance. |
|
Open a new GoogleEarth instance. |
|
Quit a GoogleEarth instance. |
|
Save a grey-scale image of the current view. |
|
Set camera position and orientation. |
Table 3: CawtEarth Reference
The name of the controlled application is Excel.Application.
The procedures of package CawtExcel are implemented in namespace Excel.
They provide functionality for the following domains:
Domain |
Examples |
Application handling |
Open, Quit, GetVersion |
Workbook handling |
OpenWorkbook, AddWorkbook, SaveAs, Close |
Worksheet handling |
AddWorksheet, DeleteWorksheet, CopyWorksheet |
Row handling |
InsertRow, DeleteRow, HideRow |
Column handling |
InsertColumn, DeleteColumn, HideColumn |
Chart handling |
ChartObjToClipboard, CreateChart, AddLineChart |
Insert values |
SetCellValue, SetRowValues, SetMatrixValues |
Retrieve values |
GetCellValue, GetRowValues, GetMatrixValues |
Formatting functionality |
SetColumnWidth, SetHyperlink, SetRangeTextColor |
Clipboard functionality |
ClipboardToMatrix, ClipboardToWorksheet |
External file handling |
Csv, Raw Images, MediaWiki, Wikit, Matlab files |
External table tools handling |
Tablelist, Word tables |
Namespace Excel has an internal
namespace Enum with procedures
for all enumeration types of this package. The procedure names correspond to
the name of the enumeration type and return a list of enumeration names and
values. See the reference manual for a list of all enumeration types.
Example:
proc XlAxisGroup {} {
# xlPrimary - 1
# xlSecondary - 2
return { xlPrimary 1 xlSecondary 2 }
}
The commands are grouped and implemented in the following modules:
Implementation file |
Description |
excelConst.tcl |
All Excel enumeration types. |
excelBasic.tcl |
Basic Excel commands. |
excelUtil.tcl |
Higher-level utility commands. |
excelChart.tcl |
Higher-level commands for chart creation. |
excelCsv.tcl |
Commands for reading/writing CSV files. |
excelTablelist.tcl |
Exchange Excel data with Tablelist. |
excelMatlabFile.tcl |
Exchange Excel data with Matlab MAT-Files. Level 4 files only. |
excelWord.tcl |
Exchange Excel data with Word tables. |
excelImgRaw.tcl |
Exchange Excel data with Tk photo images. 1-channel floating-point RAW files only. |
excelMediaWiki.tcl |
Exchange Excel data with MediaWiki tables. |
excelWikit.tcl |
Exchange Excel data with Wikit tables. |
excelHtml.tcl |
Export Excel data to HTML files. |
See the following URL’s for details on table file formats:
Matlab: https://www.mathworks.com/help/pdf_doc/matlab/matfile_format.pdf
Raw images: https://docs.activestate.com/activetcl/8.6/tcl/img/doc/img-raw.html
MediaWiki: https://www.mediawiki.org/wiki/Help:Tables
Wikit: https://wiki.tcl-lang.org/page/Formatting+Rules
See the test programs Excel-*.tcl for examples on how to use the procedures of this package.
The next chapters explain the Excel modules dealing with data exchange.
Figure 2: Module excelCsv
Figure 3: Module excelTablelist
Figure 4: Module excelMatlabFile
Figure 5: Module excelWord
Figure 6: Module excelImgRaw
Figure 7: Module excelMediaWiki
Figure 8: Module excelWikit
Figure 9: Module excelHtml
The following table lists all procedures available in namespace Excel.
CawtExcel Procedure |
Short description |
Add a clustered column chart to a worksheet. Simple case. |
|
Add a line chart to a worksheet. Generic case. |
|
Add a line chart to a worksheet. Simple case. |
|
Add a point chart to a worksheet. Simple case. |
|
Add a radar chart to a worksheet. Simple case. |
|
Add a trend line to a series. |
|
Add a new workbook with one worksheet. |
|
Add a new worksheet to the end of a workbook. |
|
Arrange the windows of an Excel application. |
|
Copy a chart object to the clipboard. |
|
Return the matrix values contained in the clipboard. |
|
Insert the matrix values contained in the clipboard into a worksheet. |
|
Close a workbook without saving changes. |
|
Return an Excel column string as a column number. |
|
Return a column number as an Excel column string. |
|
Copy the contents of a column into another column. |
|
Copy the contents of a cell range into another cell range. |
|
Copy the contents of a worksheet into another worksheet. |
|
Copy the contents of a worksheet after another worksheet. |
|
Copy the contents of a worksheet before another worksheet. |
|
Create a new empty chart in a worksheet. |
|
Create a range string in A1 notation. |
|
Return a CSV encoded row as a list of column values. |
|
Return a matrix from a CSV encoded table string. |
|
Delete a column. |
|
Delete a row. |
|
Delete a worksheet. |
|
Delete a worksheet identified by its index. |
|
Compare two Excel files visually. |
|
Duplicate a column. |
|
Duplicate a row. |
|
Convert an Excel file to a HTML table file. |
|
Convert an Excel file to a Matlab table file. |
|
Convert an Excel file to a MediaWiki table file. |
|
Convert an Excel file to a raw photo image file. |
|
Convert an Excel file to a Wikit table file. |
|
Format a row as a header row. |
|
Freeze a range in a worksheet identified by its row/column index. |
|
Return the active workbook of an application. |
|
Return the comment text of a cell. |
|
Return a cell of a worksheet. |
|
Return a numeric cell range as an Excel range string in A1 notation. |
|
Return the cells identifier of a worksheet. |
|
Return the value of a cell. |
|
Return the value of a cell. |
|
Return the number of series of a chart. |
|
Get a specific series of a chart. |
|
Return an Excel column string or number as a column number. |
|
Return a numeric column range as an Excel range string. |
|
Return column values as a Tcl list. |
|
Returns the column separator character. |
|
Return an Excel number format string for currencies. |
|
Return the decimal separator used by Excel. |
|
Get numeric value of an enumeration. |
|
Get name of a given enumeration type and numeric value. |
|
Get names of a given enumeration type. |
|
Get available enumeration types. |
|
Get numeric value of an enumeration name. |
|
Return the default extension of an Excel file. |
|
Return the index of the first used column of a worksheet. |
|
Return the index of the first used row of a worksheet. |
|
Return the hidden columns of a worksheet. |
|
Return the hidden rows of a worksheet. |
|
Return the index of the last used column of a worksheet. |
|
Return the index of the last used row of a worksheet. |
|
Return the list item separator used by Windows. |
|
Return worksheet table values as a matrix. |
|
Return the maximum number of columns of an Excel table. |
|
Return the maximum number of rows of an Excel table. |
|
Get the identifier of a named range. |
|
Get the names of named ranges. |
|
Return an Excel number format string. |
|
Return the number of columns of a cell range. |
|
Return the number of rows of a cell range. |
|
Return the number of styles in a workbook. |
|
Return the number of used columns of a worksheet. |
|
Return the number of used rows of a worksheet. |
|
Return the number of worksheets in a workbook. |
|
Get address of a cell range as list of row/column indices. |
|
Get address of a cell range as Excel range string in A1 notation. |
|
Return characters of a cell range. |
|
Get the fill color of a cell range. |
|
Get the font attibutes of a cell or character range. |
|
Get the bold font style of a cell range. |
|
Get the italic font style of a cell range. |
|
Get the font name of a cell or character range. |
|
Get the font size of a cell range. |
|
Get the subscript font style of a cell or character range. |
|
Get the superscript font style of a cell or character range. |
|
Get the underline font style of a cell range. |
|
Get the number format of a cell range. |
|
Get the horizontal alignment of a cell range. |
|
Get the text color of a cell range. |
|
Return range values as a matrix. |
|
Get the vertical alignment of a cell range. |
|
Get the wrap text mode of a cell range. |
|
Return row values as a Tcl list. |
|
Find a style by its index or name. |
|
Return the header line of a tablelist as a list. |
|
Return the values of a tablelist as a matrix. |
|
Return the thousands separator used by Excel. |
|
Return the version of an Excel application. |
|
Find an open workbook by its name. |
|
Return the name of a workbook. |
|
Return worksheet table as a matrix. |
|
Find a worksheet by its index. |
|
Find a worksheet by its name. |
|
Find a worksheet index by its name. |
|
Return the name of a worksheet. |
|
Hide or unhide a column. |
|
Hide or unhide a row. |
|
Put a photo image into a worksheet. |
|
Import data from an external data source. |
|
Insert a new empty column. |
|
Insert an image into a worksheet. |
|
Insert a new empty row. |
|
Check, if Excel object is a workbook identifier. |
|
Check, if a workbook is open. |
|
Check, if a workbook is protected. |
|
Check, if a worksheet is empty. |
|
Check, if a worksheet is content protected. |
|
Check, if a worksheet is visible. |
|
Return a list of column values as a CSV encoded row string. |
|
Map the name of a worksheet to confirm to Excel constraints. |
|
Convert a Matlab table file to an Excel file. |
|
Insert the data values of a Matlab file into a worksheet. |
|
Copy a matrix into the clipboard. |
|
Return a CSV encoded table string from a matrix list. |
|
Convert a MediaWiki table file to an Excel file. |
|
Insert the values of a MediaWiki table file into a worksheet. |
|
Open an Excel instance. Use an already running instance, if available. |
|
Open a new Excel instance. |
|
Open a workbook, i.e. load an Excel file. |
|
Place an existing chart into a worksheet. |
|
Quit an Excel instance. |
|
Convert a raw photo image file to an Excel file. |
|
Insert the pixel values of a raw photo image into a worksheet. |
|
Read a CSV table file into a matrix. |
|
Read a Matlab file into a matrix. |
|
Read the header of a Matlab file. |
|
Read a MediaWiki table file into a matrix. |
|
Read a raw photo image into a matrix. |
|
Read the header of a raw photo image. |
|
Read a Wikit table file into a matrix. |
|
Set the position and size of a chart object. |
|
Save a workbook to an Excel file. |
|
Save a worksheet to file in CSV format. |
|
Save a chart as an image in a file. |
|
Scale an image. |
|
Toggle the screen updating of an Excel application window. |
|
Find a string in a worksheet cell range. |
|
Select all cells of a worksheet. |
|
Select a cell by its row/column index. |
|
Select a range by specifying a numeric cell range. |
|
Select a range by specifying an Excel range string in A1 notation. |
|
Set the value of a cell. |
|
Set the maximum scale of an axis of a chart. |
|
Set the minimum scale of an axis of a chart. |
|
Set the position of a chart object. |
|
Set the size of a chart object. |
|
Set the minimum and maximum scale of both axes of a chart. |
|
Set the cell range for the source of a chart. |
|
Set the tick spacing of an axis of a chart. |
|
Set the title of a chart. |
|
Set the width of a range of columns. |
|
Insert column values from a Tcl list. |
|
Set the width of a column. |
|
Set the global display mode of comments. |
|
Set the shape size of a comment. |
|
Set the column separator character. |
|
Insert row values from a Tcl list and format as a header row. |
|
Insert a hyperlink into a cell. |
|
Insert a hyperlink to a cell into another cell. |
|
Insert a hyperlink to a file into a cell. |
|
Insert an internal link to a cell into another cell. |
|
Set the list item separator used by Excel. |
|
Insert matrix values into a worksheet. |
|
Set the name of a cell range. |
|
Set the attributes of one border of a cell range. |
|
Set the attributes of all borders of a cell range. |
|
Set the comment text of a cell range. |
|
Set the fill color of a cell range. |
|
Set the font attibutes of a cell or character range. |
|
Set the bold font style of a cell range. |
|
Set the italic font style of a cell range. |
|
Set the font name of a cell or character range. |
|
Set the font size of a cell range. |
|
Set the subscript font style of a cell or character range. |
|
Set the superscript font style of a cell or character range. |
|
Set the underline font style of a cell range. |
|
Set the number format of a cell range. |
|
Set the horizontal alignment of a cell range. |
|
Merge/Unmerge a range of cells. |
|
Set the text color of a cell range. |
|
Set a selection based tooltip for a cell range. |
|
Set range values from a matrix. |
|
Set the vertical alignment of a cell range. |
|
Set the text wrapping mode of a cell range. |
|
Set the height of a row. |
|
Set the height of a range of rows. |
|
Insert row values from a Tcl list. |
|
Set the attributes of a series. |
|
Set the line width of a series. |
|
Insert header values into a tablelist. |
|
Insert matrix values into a tablelist. |
|
Set the window state of an Excel application. |
|
Adjust a worksheet to fit onto given number of pages. |
|
Set the texts of the footer of a worksheet. |
|
Set the texts of the header of a worksheet. |
|
Set the margins of a worksheet. |
|
Set the name of a worksheet. |
|
Set the orientation of a worksheet. |
|
Set the paper size of a worksheet. |
|
Set printing options of a worksheet. |
|
Set the color of the tab of a worksheet. |
|
Set the zoom factor for printing of a worksheet. |
|
Toggle the display of Excel application alerts. |
|
Show a cell identified by its row/column index. |
|
Show a worksheet. |
|
Insert the values of a tablelist into a worksheet. |
|
Toggle the AutoFilter switch of a cell range. |
|
Unhide a worksheet, if it is hidden. |
|
Toggle usage of transparency channel of an image. |
|
Set or query the visibility of an Excel application window. |
|
Convert a Wikit table file to an Excel file. |
|
Insert the values of a Wikit table file into a worksheet. |
|
Insert the values of a Word table into a worksheet. |
|
Copy worksheet data into the clipboard. |
|
Write the values of a worksheet into a HTML table file. |
|
Put worksheet background colors into a photo image. |
|
Insert the values of a worksheet into a Matlab file. |
|
Insert the values of a worksheet into a MediaWiki table file. |
|
Insert the values of a worksheet into a raw photo image file. |
|
Insert the values of a worksheet into a tablelist. |
|
Insert the values of a worksheet into a Wikit table file. |
|
Insert the values of a worksheet into a Word table. |
|
Write the values of a matrix into a CSV file. |
|
Write the values of a matrix into a Html table file. |
|
Write the values of a matrix into a Matlab file. |
|
Write the values of a matrix into a MediaWiki table file. |
|
Write the values of a matrix into a raw photo image file. |
|
Write the values of a matrix into a Wikit table file. |
Table 4: CawtExcel Reference
The name of the controlled application is InternetExplorer.Application.
The procedures of package CawtExplorer are implemented in namespace Explorer.
They provide functionality for the following domains:
Domain |
Examples |
Application handling |
Open, Quit |
URL navigation |
Navigate, GoBack, GoHome |
See the test programs Explorer-*.tcl for examples on how to use the procedures of this package.
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
The following table lists all procedures available in namespace Explorer.
CawtExplorer Procedure |
Short description |
Toggle the fullscreen mode of an Internet Explorer application window. |
|
Go to a specific page. |
|
Check, if an Internet Explorer instance is busy. |
|
Navigate to a URL or local file. |
|
Open an Internet Explorer instance. |
|
Open a new Internet Explorer instance. |
|
Quit an Internet Explorer instance. |
|
Toggle the visibility of an Internet Explorer application window. |
Table 5: CawtExplorer Reference
The name of the controlled application is Matlab.Application.
The procedures of package CawtMatlab are implemented in namespace Matlab.
They provide functionality for the following domains:
Domain |
Examples |
Application handling |
Open, Quit |
Command execution |
ExecCmd |
See the test programs Matlab-*.tcl for examples on how to use the procedures of this package.
The following table lists all procedures available in namespace Matlab.
CawtMatlab Procedure |
Short description |
Execute a Matlab command. |
|
Open a Matlab instance. |
|
Open a new Matlab instance. |
|
Quit a Matlab instance. |
|
Toggle the visibility of a Matlab application window. |
Table 6: CawtMatlab Reference
The name of the controlled application is MODI.Document.
The procedures of package CawtOcr are implemented in namespace Ocr.
They provide functionality for the following domains:
Domain |
Examples |
Application handling |
Open, Close |
Character recognition |
Scan, GetFullText, GetWord, GetWordStatistics |
See the test programs Ocr-*.tcl for examples on how to use the procedures of this package.
The following table lists all procedures available in namespace Ocr.
CawtOcr Procedure |
Short description |
Close an OCR document instance. |
|
Return the recognized text of an OCR layout. |
|
Return the number of images of an OCR document. |
|
Return the number of words identified in an OCR document. |
|
Return the text of a recognized word. |
|
Return statistics of a recognized word. |
|
Open an OCR document instance. |
|
Open an image file for OCR scanning. |
|
Scan an image. |
Table 7: CawtOcr Reference
The name of the controlled application is OneNote.Application.
The procedures of package CawtOneNote are implemented in namespace OneNote.
They provide functionality for the following domains:
Domain |
Examples |
Application handling |
Open, Quit, GetVersion |
Retrieving information |
GetNotebooks, GetSections, GetPages |
See the test programs OneNote-*.tcl for examples on how to use the procedures of this package.
The following table lists all procedures available in namespace OneNote.
CawtOneNote Procedure |
Short description |
Get a specific node by name. |
|
Get a specific notebook by name. |
|
Get a specific page by name. |
|
Get a specific section by name. |
|
Get the application identifier of a OneNote object. |
|
Get the DOM identifier of a OneNote object. |
|
Get the DOM root of a OneNote object. |
|
Get numeric value of an enumeration. |
|
Get name of a given enumeration type and numeric value. |
|
Get names of a given enumeration type. |
|
Get available enumeration types. |
|
Get numeric value of an enumeration name. |
|
Return the default extension of a OneNote file. |
|
Get nodes with specific modification date. |
|
Get attribute value of a DOM node. |
|
Get hyperlink to OneNote node. |
|
Get value of node attribute name. |
|
Get nodes of specific type. |
|
Get type of a DOM node. |
|
Get the notebooks of a OneNote object. |
|
Get page content as XML. |
|
Get the pages of a OneNote section. |
|
Get the sections of a OneNote notebook. |
|
Return the version of a OneNote application. |
|
Check, if node is of specific type. |
|
Open a OneNote instance. |
|
Print page content as XML to standard output. |
|
Quit a OneNote instance. |
Table 8: CawtOneNote Reference
The name of the controlled application is Outlook.Application.
The procedures of package CawtOutlook are implemented in namespace Outlook.
They provide functionality for the following domains:
Domain |
Examples |
Application handling |
Open, Quit, GetVersion |
Account handling |
GetAccountId, GetAccountSmtpAddresses |
Mail handling |
CreateMail, CreateHtmlMail, SendMail |
Calendar handling |
AddCalendar, DeleteCalendar, GetCalendarId |
Category handling |
AddCategory, DeleteCategory, GetCategoryId |
Contact handling |
AddContact, GetContactProperties |
Appointment handling |
AddAppointment, DeleteAppointment |
Holiday file handling |
ReadHolidayFile, ApplyHolidayFile |
Namespace Outlook has an internal namespace Enum with procedures for all enumeration types of this package. The procedure names correspond to the name of the enumeration type and return a list of enumeration names and values. See the reference manual for a list of all enumeration types.
Example:
proc OlAlignment {} {
# olAlignmentLeft - 0
# olAlignmentRight - 1
return { olAlignmentLeft 0 olAlignmentRight 1 }
}
The commands are grouped and implemented in the following modules:
Implementation file |
Description |
outlookConst.tcl |
All Outlook enumeration types. |
outlookBasic.tcl |
Basic Outlook commands. |
outlookCalendar.tcl |
Outlook calendar commands. |
outlookColor.tcl |
Outlook commands related to color handling. |
outlookContact.tcl |
Outlook contact commands. |
outlookAccount.tcl |
Outlook account commands. |
outlookMail.tcl |
Outlook mail commands. |
See the test programs Outlook-*.tcl for examples on how to use the procedures of this package.
Note: The Outlook test programs send test mails and modify the Outlook calendar.
The following table lists all procedures available in namespace Outlook.
CawtOutlook Procedure |
Short description |
Create a new appointment in an Outlook calendar. |
|
Add a new Outlook calendar. |
|
Add a new category to the Outlook categories. |
|
Create a new contact in an Outlook contact folder. |
|
Add a new Outlook contact folder. |
|
Create a new appointment in an Outlook calendar. |
|
Read an Outlook holiday file and insert appointments. |
|
Create a new Outlook HTML mail. |
|
Create a new Outlook text mail. |
|
Delete an appointment of an Outlook calendar by its index. |
|
Delete an Outlook calendar. |
|
Delete an Outlook category. |
|
Delete a contact of an Outlook contact folder by its index. |
|
Delete an Outlook contact folder. |
|
Get an account by its index or SMTP address. |
|
Get a list of account SMTP addresses. |
|
Get an appointment of an Outlook calendar by its index. |
|
Get properties of an Outlook appointment. |
|
Get an Outlook calendar by its name. |
|
Get a list of Outlook calendar names. |
|
Convert a category color enumeration or name |
|
Convert a category color enumeration or name into a color enumeration. |
|
Convert a category color enumeration into a category color name. |
|
Get all category color names. |
|
Get a category by its index or name. |
|
Get a list of category names. |
|
Get a contact of an Outlook contact folder by its index. |
|
Get an Outlook contact folder by its name. |
|
Get a list of Outlook contact folder names. |
|
Get property values of an Outlook contact. |
|
Get a list of Outlook contact read-only property names. |
|
Get a list of Outlook contact read-write property names. |
|
Get numeric value of an enumeration. |
|
Get name of a given enumeration type and numeric value. |
|
Get names of a given enumeration type. |
|
Get available enumeration types. |
|
Get numeric value of an enumeration name. |
|
Get all Outlook folders of a specific type. |
|
Get a list of mail identifiers. |
|
Get a list of mail subjects. |
|
Get the number of Outlook accounts. |
|
Get the number of appointments in an Outlook calendar. |
|
Get the number of Outlook calendars. |
|
Get the number of Outlook categories. |
|
Get the number of Outlook contact folders. |
|
Get the number of contacts in an Outlook contact folder. |
|
Get the version of an Outlook application. |
|
Check, if an Outlook calendar exists. |
|
Check, if a category already exists. |
|
Check, if an Outlook contact folder exists. |
|
Open an Outlook instance. |
|
Quit an Outlook instance. |
|
Read an Outlook holiday file. |
|
Send an Outlook mail. |
|
Set property values of an Outlook contact. |
Table 9: CawtOutlook Reference
The name of the controlled application is PowerPoint.Application.
The procedures of package CawtPpt are implemented in namespace Ppt.
They provide functionality for the following domains:
Domain |
Examples |
Application handling |
Open, Quit, GetVersion |
Presentation handling |
OpenPres, AddPres, SaveAs, Close |
Slide handling |
AddSlide, CopySlide, ShowSlide, ExportSlide |
SlideShow handling |
UseSlideShow, SlideShowFirst, SlideShowNext |
Shape handling |
AddShape, ConfigureShape, ConnectShapes |
Custom layout handling |
GetNumCustomLayouts, GetCustomLayoutName |
Namespace Ppt has an internal namespace Enum with procedures for all enumeration types of this package. The procedure names correspond to the name of the enumeration type and return a list of enumeration names and values. See the reference manual for a list of all enumeration types.
Example:
proc PpArrangeStyle {} {
# ppArrangeCascade - 2
# ppArrangeTiled - 1
return { ppArrangeCascade 2 ppArrangeTiled 1 }
}
See the test programs Ppt-*.tcl for examples on how to use the procedures of this package.
The following table lists all procedures available in namespace Ppt.
CawtPpt Procedure |
Short description |
Add a new empty presentation. |
|
Add a new shape to a slide. |
|
Add a new slide to a presentation. |
|
Add a text box into a slide. |
|
Add a text string to a text box. |
|
Check video creation status. |
|
Close a presentation without saving changes. |
|
Close all presentations of a PowerPoint instance. |
|
Configure a connector. |
|
Configure a shape. |
|
Add a new connector connecting two shapes. |
|
Make a copy of a slide. |
|
Create a video from a presentation. |
|
Exit specified slide show. |
|
Export a PowerPoint file to an image sequence. |
|
Export a slide as an image. |
|
Export a range of slides as image files. |
|
Return the active presentation of an application. |
|
Return the left position of a comment with specific key. |
|
Return the top-left position of a comment with specific key. |
|
Return the top position of a comment with specific key. |
|
Return the value of a key stored in a comment. |
|
Get the comment texts of a slide as a Tcl list. |
|
Get video creation status. |
|
Return the current slide index of a presentation. |
|
Get a custom layout by its index or name. |
|
Return the name of a custom layout. |
|
Get numeric value of an enumeration. |
|
Get name of a given enumeration type and numeric value. |
|
Get names of a given enumeration type. |
|
Get available enumeration types. |
|
Get numeric value of an enumeration name. |
|
Return the default extension of a PowerPoint file. |
|
Return the number of comments of a slide. |
|
Return the number of custom layouts of a presentation. |
|
Return the number of shapes of a slide. |
|
Return the number of sites of a shape. |
|
Return the number of images of a slide. |
|
Return the number of slides of a presentation. |
|
Return the number of slide shows of a presentation. |
|
Return the number of videos of a slide. |
|
Get PowerPoint image format from Img format. |
|
Get the images of a presentation. |
|
Get the page height of a presentation. |
|
Get the page width of a presentation. |
|
Get the videos of a presentation. |
|
Get shape identifier from shape index. |
|
Return the media type of a shape. |
|
Return the name of a shape. |
|
Return the type of a shape. |
|
Get slide identifier from slide index. |
|
Find a slide by its name. |
|
Get the images of a slide. |
|
Return the index of a slide. |
|
Return the name of a slide. |
|
Get the videos of a slide. |
|
Get the image formats supported by PowerPoint. |
|
Return the default extension of a PowerPoint template file. |
|
Return the version of a PowerPoint application. |
|
Return the view type of a presentation. |
|
Insert an image into a slide. |
|
Insert a video into a slide. |
|
Check, if the image format is supported by PowerPoint. |
|
Check, if a presentation identifier is valid. |
|
Move a slide to another position. |
|
Open a PowerPoint instance. Use an already running instance, if available. |
|
Open a new PowerPoint instance. |
|
Open a presentation, i.e. load a PowerPoint file. |
|
Quit a PowerPoint instance. |
|
Save a presentation to a PowerPoint file. |
|
Create a hyperlink from a shape to a slide. |
|
Set the play settings of a media (audio or video). |
|
Set the page size of a presentation. |
|
Set the name of a shape. |
|
Set the name of a worksheet. |
|
Set transition attributes of a slide. |
|
Set the font size of the text in a text box. |
|
Set the view type of a presentation. |
|
Toggle the display of PowerPoint application alerts. |
|
Show a specific slide. |
|
Go to first slide in slide show. |
|
Go to last slide in slide show. |
|
Go to next slide in slide show. |
|
Go to previous slide in slide show. |
|
Use specified slide show. |
|
Toggle the visibility of a PowerPoint application window. |
Table 10: CawtPpt Reference
Note: Acrobat Reader is currently not controlled by the COM interface, but uses the program command line options.
The procedures of package CawtReader are implemented in namespace Reader.
They provide functionality for the following domains:
Domain |
Examples |
Application handling |
Open, OpenNew, Quit, SetReaderProg |
See the test programs Reader-*.tcl for examples on how to use the procedures of this package.
The following table lists all procedures available in namespace Reader.
CawtReader Procedure |
Short description |
Open an Acrobat Reader instance. |
|
Open a new Acrobat Reader instance. |
|
Quit all Acrobat Reader instances. |
|
Set the path to Acrobat Reader program. |
Table 11: CawtReader Reference
The name of the controlled application is sapi.SpVoice.
The procedures of package CawtSapi are implemented in namespace Sapi.
They provide functionality for the following domains:
Domain |
Examples |
Application handling |
Open |
Voice handling |
GetVoiceByName, GetVoiceNames, SetVoice |
Speaking |
SetSpeakOptions, Speak |
See the test programs Sapi-*.tcl for examples on how to use the procedures of this package.
The following table lists all procedures available in namespace Sapi.
CawtSapi Procedure |
Short description |
Get numeric value of an enumeration. |
|
Get name of a given enumeration type and numeric value. |
|
Get names of a given enumeration type. |
|
Get available enumeration types. |
|
Get numeric value of an enumeration name. |
|
Get speak options. |
|
Get a voice identifier by specifying its name. |
|
Get a list of voice names. |
|
Open a SAPI object instance. |
|
Set speak options. |
|
Set the voice for speaking. |
|
Speak a sentence. |
Table 12: CawtSapi Reference
The name of the controlled application is Word.Application.
The procedures of package CawtWord are implemented in namespace Word.
They provide functionality for the following domains:
Domain |
Examples |
Application handling |
Open, Quit, GetVersion |
Document handling |
OpenDocument, AddDocument, SaveAs, Close |
Table handling |
AddTable, GetNumRows, SetCellValue, GetCellValue |
Text handling |
AddParagraph, AppendText, AddText |
Range handling |
GetStartRange, GetRangeStartIndex, ExtendRange |
Search/Replace functionality |
FindString, ReplaceString, ReplaceByProc, Search |
Formatting functionality |
SetRangeFontBold, SetRangeBackgroundColor |
Caption handling |
InsertCaption, ConfigureCaption |
Bookmark handling |
AddBookmark, GetBookmarkName, SetLinkToBookmark |
Hyperlink handling |
GetHyperlinksAsDict, GetNumHyperlinks |
List handling |
GetListGalleryId, GetListTemplateId, InsertList |
Namespace Word has an internal namespace Enum with procedures for all enumeration types of this package. The procedure names correspond to the name of the enumeration type and return a list of enumeration names and values. See the reference manual for a list of all enumeration types.
Example:
proc WdBookmarkSortBy {} {
# wdSortByLocation - 1
# wdSortByName - 0
return { wdSortByLocation 1 wdSortByName 0 }
}
See the test programs Word-*.tcl for examples on how to use the procedures of this package.
The following table lists all procedures available in namespace Word.
CawtWord Procedure |
Short description |
Add a bookmark to a text range. |
|
Add a content control to a text range. |
|
Add a new empty document to a Word instance. |
|
Add a new table and fill the cells with images. |
|
Add a page break to a text range. |
|
Add a new paragraph to a document. |
|
Add one or more rows to a table. |
|
Add a new table in a text range. |
|
Add text to a Word document. |
|
Append a paragraph at the end of the document. |
|
Append text to a Word document. |
|
Close a document without saving changes. |
|
Collapse a text range to the start or end position. |
|
Configure style of a caption type identified by its label identifier. |
|
Copy the contents of a range into another range. |
|
Count words contained in a Word document. |
|
Create a new text range. |
|
Create a new text range after specified range. |
|
Crop an image at the four borders. |
|
Delete a row of a table. |
|
Delete all subdocument links from a Word document. |
|
Delete a table. |
|
Compare two Word files visually. |
|
Expand all subdocuments in a Word document. |
|
Extend the range indices of a text range. |
|
Find a string in a text range or a document. |
|
Format a row as a header row. |
|
Get the name of a bookmark. |
|
Get the names of all bookmarks of a document. |
|
Return a cell or cells of a Word table as a range. |
|
Return the value of a Word table cell. |
|
Return a column of a Word table as a selection. |
|
Return column values of a Word table as a Tcl list. |
|
Return the compatibility version of a Word application. |
|
Get all cross reference items of a given type. |
|
Get the document identifier of a Word component. |
|
Find a document by its index. |
|
Get the name of a document. |
|
Return the text range representing the end of the document. |
|
Get numeric value of an enumeration. |
|
Get name of a given enumeration type and numeric value. |
|
Get names of a given enumeration type. |
|
Get available enumeration types. |
|
Get numeric value of an enumeration name. |
|
Return the default extension of a Word file. |
|
Get the text of the document footer. |
|
Get the text of the document header. |
|
Get the ranges of a specific heading level. |
|
Get a dictionary with headings of a document. |
|
Get a dictionary with hyperlinks of a document. |
|
Find an image by its index or name. |
|
Get a list of images of a Word document. |
|
Return the name of an image. |
|
Get one of the 3 predefined list galleries. |
|
Get one of the 7 predefined list templates. |
|
Return table values as a matrix. |
|
Return the number of characters in a Word document. |
|
Return the number of columns of a Word table. |
|
Return the number of documents in a Word application. |
|
Return the number of hyperlinks of a Word document. |
|
Return the number of images of a Word document. |
|
Return the number of pages in a Word document. |
|
Return the number of rows of a Word table. |
|
Return the number of subdocuments in a Word document. |
|
Return the number of tables of a Word document. |
|
Get page setup values. |
|
Return the end index of a text range. |
|
Get font specific parameters. |
|
Get information about a text range. |
|
Return the screen position of a text range. |
|
Return the start index of a text range. |
|
Return the text of a text range. |
|
Return identifier of a Word table row. |
|
Return rows of a Word table as a range. |
|
Return row values of a Word table as a Tcl list. |
|
Return the text range representing the current selection. |
|
Return a text range representing the start of the document. |
|
Return the file path of a subdocument. |
|
Find a table by its index. |
|
Find table(s) by its name. |
|
Return the name of a table. |
|
Return the version of a Word application. |
|
Insert a caption into a range of a document. |
|
Insert a file into a Word document. |
|
Insert an image into a range of a document. |
|
Insert a Word list. |
|
Insert text in a Word document. |
|
Check, if a Word object is an InlineShape. |
|
Check, if a Word table cell is valid. |
|
Check the visibility of a Word application window. |
|
Merge a range of cells. |
|
Open a Word instance. Use an already running instance, if available. |
|
Open a document, i.e. load a Word file. |
|
Open a new Word instance. |
|
Print the contents of a heading dictionary onto stdout. |
|
Print the contents of a hyperlink dictionary onto stdout. |
|
Print the indices of a text range. |
|
Quit a Word instance. |
|
Replace a string in a text range. Procedural case. |
|
Replace an existing image. |
|
Replace a string in a text range or a document. Simple case. |
|
Save a document to a Word file. |
|
Save a document to a PDF file. |
|
Scale an image. |
|
Toggle the screen updating of a Word application window. |
|
Search or replace a string in a text range or a document. Generic case. |
|
Select a text range. |
|
Set the value of a Word table cell. |
|
Set the vertical alignment of a Word table cell. |
|
Set the width of a range of table columns. |
|
Insert column values into a Word table. |
|
Set the width of a table column. |
|
Set the compatibility mode of a document. |
|
Set the values for a content control dropdown list. |
|
Set the text of a content control. |
|
Insert row values into a Word table and format as a header row. |
|
Set the HeadingFormat flag of table rows. |
|
Insert an external hyperlink into a Word document. |
|
Insert a hyperlink to a file into a Word document. |
|
Set the name of an image. |
|
Insert an internal hyperlink into a Word document. |
|
Insert an internal link to a bookmark into a Word document. |
|
Insert matrix values into a Word table. |
|
Set page setup values. |
|
Set the background color of a table cell range. |
|
Set the background color of a table cell range. |
|
Set the end index of a text range. |
|
Set font specific parameters. |
|
Set the background color of a text range. |
|
Toggle the bold font style of a text range. |
|
Set the text color of a text range. |
|
Toggle the italic font style of a text range. |
|
Set the font name of a text range. |
|
Set the font size of a text range. |
|
Toggle the underline font style of a text range. |
|
Set the highlight color of a text range. |
|
Set the horizontal alignment of a text range. |
|
Merge a range of cells. |
|
Set the start index of a text range. |
|
Set the style of a text range. |
|
Set the height of a table row. |
|
Insert row values from a Tcl list. |
|
Set the alignment of a Word table. |
|
Set the border line styles of a Word table or cell range. |
|
Set the border line widths of a Word table or cell range. |
|
Set the name of a table. |
|
Set miscellaneous table options. |
|
Set the vertical alignment of all Word table cells. |
|
Set view parameters of a document. |
|
Toggle the display of Word application alerts. |
|
Toggle checking of grammatical and spelling errors. |
|
Trim a string. |
|
Update all fields as well as tables of content and figures of a document. |
|
Toggle the visibility of a Word application window. |
Table 13: CawtWord Reference
This chapter contains miscellaneous information about CAWT.
The CAWT package is copyrighted by Paul Obermeier and distributed under the 3-clause BSD license. See file CAWT-License.txt in the CAWT distribution for the license text.
CAWT relies on several other Tcl packages. See the table in chapter 1.2 Dependencies for links to these packages to get their license information.
CAWT includes the following scripts, which can be used as standalone applications:
The application EnumExplorer.tcl can be used to explore the common Office enumerations as well as the enumerations of the Office applications Excel, OneNote, Outlook, PowerPoint, Sapi and Word.
Figure 10: Screenshot of EnumExplorer.tcl
If started with option --help, it prints out a usage message:
> tclsh EnumExplorer.tcl --help
Usage: EnumExplorer.tcl [Namespace]
Start enumeration explorer and display specified namespace.
If no namespace is given, the first namespace in this list is used:
Office Excel Ppt Word Outlook OneNote Sapi
Pressing the "Copy as enum" button or the "C" key copies the
currently selected enumeration as Tcl variable to the clipboard.
Example: $Excel::xlAboveStdDev
Pressing the "Copy as string" button or the "c" key copies the
currently selected enumeration name to the clipboard.
Example: xlAboveStdDev
The application OneNoteInfo.tcl can be used to either retrieve information about OneNote notebooks, sections or pages as well as send Outlook mails about changed pages.
If started with option --help, it prints out a usage message:
> tclsh OneNoteInfo.tcl --help
Usage: OneNoteInfo.tcl [Options]
Utility program to retrieve information from OneNote.
Actions:
--help : Print help message and exit.
--print : Print information about notebooks, sections or pages to stdout.
If no other option is given, print a list of all notebook names.
If --notebook is given, print all section names of that notebook.
If --section and --notebook are given, print all page names of
that section.
--check : Find recently changed pages.
Use options --days and --mail to change default behaviour.
Default is: Look back 1 days. Print found page names to stdout.
Options:
--notebook <string>: Check or print specified notebook.
--section <string> : Check or print specified section.
--page <string> : Check or print specified page.
--xml <string> : Print information in OneNote XML format.
--days <int> : Specify number of days for recently changed pages.
--mail <string> : Send list of recently changed pages via Outlook mail.
If given string is a valid file name, scan that file
for mail addresses. Each line must contain key
"always" or "option" followed by a mail address.
Otherwise the string is expected to be a mail address.
--test : Build Outlook mail, but do not send. Use for testing.
Example: Find all pages changed in the last 20 days and send that information via Outlook HTML mail to a list of defined users. The table of changed pages contains links to the corresponding notebooks, sections and pages.
> tclsh OneNoteInfo.tcl --check --days 20 --notebook CAWT --mail OneNoteMailList.txt
Figure 11: Auto-generated Outlook mail from OneNoteInfo.tcl
The application Word2Pdf.tcl can be used to convert a Word file to a PDF file.
Note, that PDF export is supported by Word since version 2007.
If started with option --help, it prints out a usage message:
> tclsh Word2Pdf.tcl --help
Usage: Word2Pdf.tcl [Options] WordFile PdfFile
Options: None at the moment.
The application WordAbbrCheck.tcl can be used to list and count the words contained in a Word document. The output may be used to check for used abbreviations in the document, which are not contained in an abbreviation table.
Note: The functionality of this program is available with a graphical user interface in the poApps Office module. poApps is available at https://www.tcl3d.org/poApps/.
If started with option --help, it prints out a usage message:
> tclsh WordAbbrCheck.tcl --help
Usage: WordAbbrCheck.tcl [Options] WordFile
Open a Word document and perform several checks and statistics.
If no options are specified, the number of words in the document
are counted.
Options:
--help : Print this help message.
--showfiles : Open log and result files after generation.
--outfile <string> : Store results in given file.
Use "stdout" to print to standard output.
Default: Results are stored in a file with
same root name as input file, but extension ".txt".
--minlength <int> : Only count words having more than minlength
characters. Default: 2 characters.
--maxlength <int> : Only count words having less than maxlength
characters. Default: Unlimited.
--nonumbers : Only count words which are no numbers.
--sortmode <string>: Sorting mode of word output.
Default: length.
Possible values: dictionary, length, increasing, decreasing.
--csv : Write result data in CSV format.
Default: Space seperated.
--printtables : Print table names of the Word file and exit.
--abbr <string> : Title of a table in the Word file containing
abbreviations. It is assumed, that the abbreviations
start in row 2 and are listed in column 1.
--links : Check validity of internal and external links.
This chapter gives an overview of the available test programs and describes how to execute the tests.
The following test and demonstration programs are currently available:
Test Program |
Description |
Cawt-01_Basic.tcl |
Test basic functionality of the CawtCore package. |
Cawt-02_Color.tcl |
Test color functionality of the CawtCore package. |
Cawt-03_Date.tcl |
Test date conversion functionality of the CawtCore package. |
Cawt-04_String.tcl |
Test string functionalities of the CawtCore package. |
Cawt-05_File.tcl |
Test file handling functionality of the CawtCore package. |
Cawt-06_Img.tcl |
Test image handling functionality of the CawtCore package. |
Cawt-07_ComObj.tcl |
Test COM object functionality of the CawtCore package. |
Cawt-08_TestUtil.tcl |
Test Check functionality of the CawtCore package. |
Cawt-09_Embed.tcl |
Test embedding procedures of the CawtCore package. |
Cawt-10_Interpolate.tcl |
Test interpolation functionality of the CawtCore package. |
Cawt-11_Url.tcl |
Test CawtCore procedures for checking URL addresses. |
Earth-01_Basic.tcl |
Test basic functionality of the CawtEarth package. |
Earth-02_MunichTour.tcl |
Load position information into an Excel sheet, read back that information and create a Tk GUI with buttons corresponding to these positions. |
Excel-01_Basic.tcl |
Test basic functionality of the CawtExcel package. |
Excel-02_Misc.tcl |
Test miscellaneous CawtExcel procedures like setting colors, column width, inserting formulas and searching. |
Excel-03_Add.tcl |
Test CawtExcel procedures for adding and deleting workbooks and worksheets. |
Excel-04_Insert.tcl |
Test CawtExcel procedures for inserting data as rows, columns or matrices. |
Excel-05_Ranges.tcl |
Test CawtExcel procedures for retrieving the number of (used) rows and columns. |
Excel-06_Chart.tcl |
Test CawtExcel procedures for creating charts and exporting charts as Tk photo images. |
Excel-07_Csv.tcl |
Test CawtExcel procedures related to CSV files. |
Excel-07_CsvUniCode.tcl |
Test CawtExcel procedures related to CSV files. |
Excel-08_Tablelist.tcl |
Test CawtExcel procedures to exchange data between Excel and Tablelist. |
Excel-08_TablelistSelection.tcl |
Test CawtExcel procedures to exchange data between Excel and Tablelist. |
Excel-09_WordTable.tcl |
Test CawtExcel procedures to exchange data between Excel and Word tables. |
Excel-10_Matrix.tcl |
Test CawtExcel procedures to read data into a matrix and write matrix data into Matlab or RAW image files. |
Excel-11_RawImage-16bit.tcl |
Test CawtExcel procedures to exchange data between Excel and 16-bit integer RAW images. |
Excel-11_RawImage.tcl |
Test CawtExcel procedures to exchange data between Excel and 32-bit floating point RAW images. |
Excel-12_MatlabFile.tcl |
Test CawtExcel procedures to exchange data between Excel and Matlab files. |
Excel-13_MediaWiki.tcl |
Test CawtExcel procedures to exchange data between Excel and MediaWiki tables. |
Excel-14_Wikit.tcl |
Test CawtExcel procedures to exchange data between Excel and Wikit tables. |
Excel-14_WikitWithLinks.tcl |
Test CawtExcel procedures to export an Excel workbook as Wikit tables with hyperlinks. |
Excel-15_Clipboard.tcl |
Test CawtExcel procedures to exchange data between Excel and the Windows clipboard. |
Excel-16_SetGet.tcl |
Test CawtExcel procedures for setting and getting cell values. |
Excel-17_Diff.tcl |
Test CawtExcel procedure for diff'ing Excel files. |
Excel-17_DiffEqual.tcl |
Test CawtExcel procedure for diff'ing Excel files. |
Excel-18_SparseMatrix.tcl |
Test CawtExcel procedures for handling sparse matrices. |
Excel-19_MarkLink.tcl |
Test CawtExcel procedures related to marking and linking cells. |
Excel-20_ImgUtil.tcl |
Test CawtExcel procedures for dealing with images. |
Excel-21_ImgCell.tcl |
Test CawtExcel procedures for inserting images using cell background colors. |
Excel-22_Html.tcl |
Test CawtExcel procedures to export Excel data to a HTML file. |
Excel-23_Font-Attributes.tcl |
Test CawtExcel procedures related to font attribute handling. |
Excel-23_Font.tcl |
Test CawtExcel procedures related to font handling. |
Excel-24_Format.tcl |
Test CawtExcel procedures related to specifying number formats. |
Excel-25_Properties.tcl |
Test CawtExcel procedures related to property handling. |
Excel-26_PageSetup.tcl |
Test CawtExcel procedures related to page setup and printing. |
Excel-27_RowColumn.tcl |
Test CawtExcel procedures for row and column handling: Insert, delete, hide, duplicate. |
Excel-28_NamedRange.tcl |
Test CawtExcel procedures related to named ranges. |
Excel-29_EmptySheet.tcl |
Test CawtExcel procedures dealing with empty worksheets. |
Excel-30_SelectRange.tcl |
Test miscellaneous CawtExcel procedures like setting colors, column width, inserting formulas and searching. |
Excel-31_Import.tcl |
Test CawtExcel procedures related to import functionality. |
Excel-32_Quit.tcl |
Test quitting Excel without saving modified worksheets. |
Excel-33_AddAndRunMacro.tcl |
Test CawtOffice procedures to add Excel macros (Sub and Function) from a string and run these macros. |
Excel-33_ImportAndRunMacro.tcl |
Test CawtOffice procedures to add Excel macros (Sub and Function) from a source file and run these macros. |
Excel-33_RunMacro.tcl |
Test CawtOffice procedures to run macros (Sub and Function) contained in an Excel file. |
Excel-34_Events.tcl |
Test event handling functionality of Excel. |
Excel-35_Styles.tcl |
Test CawtExcel procedures related to Styles handling. |
Excel-36_Embed.tcl |
Test CawtExcel procedures for embedding an Excel workbook into a Tk frame. |
Excel-37_WorksheetName.tcl |
Test CawtExcel procedures for mapping worksheet names. |
Excel-38_Interpolate.tcl |
Test interpolation functionality of the CawtCore package in Excel example. |
Excel-39_DateTime.tcl |
Test CawtExcel procedures related to dates and times. |
Explorer-01_Basic.tcl |
Test basic functionality of the CawtExplorer package. |
Explorer-02_Misc.tcl |
Test miscellaneous CawtExplorer functions like navigating to an URL and using fillscreen mode. |
Explorer-03_Events.tcl |
Test event handling functionality of Internet Explorer. |
Matlab-01_Basic.tcl |
Test basic functionality of the CawtMatlab package. |
Matlab-02_MFile.tcl |
Test CawtMatlab procedures for executing Matlab commands. |
Ocr-01_Basic.tcl |
Test basic functionality of the CawtOcr package. |
Ocr-02_Misc.tcl |
Test miscellaneous CawtOcr procedures. |
OneNote-01_Basic.tcl |
Test basic functionality of the CawtOneNote package. |
Outlook-01_Basic.tcl |
Test basic functionality of the CawtOutlook package. |
Outlook-02_Mail.tcl |
Test mail functionality of the CawtOutlook package. Note: This script sends two test mails (in text and HTML format) to cawt@tcl3d.org. |
Outlook-03_Holiday.tcl |
Test holiday appointment functionality of the CawtOutlook package. Note: This script sets appointments in your Outlook calendar. |
Outlook-04_Appointment.tcl |
Test appointment functionality of the CawtOutlook package. Note: This script sets appointments in your Outlook calendar. |
Outlook-05_MailFolders.tcl |
Test mail folder functionality of the CawtOutlook package. |
Outlook-06_ContactFolders.tcl |
Test contact functionality of the CawtOutlook package. |
Outlook-07_Accounts.tcl |
Test account functionality of the CawtOutlook package. |
Ppt-01_Basic.tcl |
Test basic functionality of the CawtPpt package. |
Ppt-02_Misc.tcl |
Test miscellaneous CawtPpt procedures like adding slides, inserting images and saving slides as image files. |
Ppt-03_Add.tcl |
Test CawtPpt procedures for adding and copying slides. |
Ppt-04_Present.tcl |
Test CawtPpt procedures for presenting a slide show. |
Ppt-05_Export.tcl |
Test CawtPpt procedures for exporting a PowerPoint presentation as HTML slide show. |
Ppt-06_CustomLayout.tcl |
Test CawtPpt procedures for using PowerPoint custom layouts. |
Ppt-07_Properties.tcl |
Test CawtPpt procedures related to property handling. |
Ppt-08_Comments.tcl |
Test CawtPpt procedures for handling PowerPoint comments. |
Ppt-09_Shapes.tcl |
Test CawtPpt procedures related to creating, manipulating and connecting shapes. |
Ppt-10_AllShapes.tcl |
Test CawtPpt procedure for creating all available shapes. |
Ppt-11_AllConnectors.tcl |
Test CawtPpt procedure for creating all available connectors. |
Ppt-12_Quit.tcl |
Test quitting PowerPoint without saving modified presentations. |
Ppt-13_Media.tcl |
Test CawtPpt procedures related to media content, i.e. images and videos. |
Ppt-14_CreateVideo.tcl |
Test creating videos from PowerPoint slides. |
Ppt-15_ButtonEvent.tcl |
Test CawtPpt procedures for simulating button events. |
Ppt-16_Embed.tcl |
Test CawtPpt procedures for embedding a PowerPoint presentation into a Tk frame. |
Reader-01_Basic.tcl |
Test basic functionality of the CawtReader package. |
Reader-02_Embed.tcl |
Test CawtExcel procedures for embedding an Acrobat Reader window into a Tk frame. |
Sapi-01_Basic.tcl |
Test basic functionality of the CawtSapi package. |
Sapi-02_Speak.tcl |
Test speaking voices of the CawtSapi package. |
Sapi-03_SpeakOptions.tcl |
Test speaking options of the CawtSapi package. |
Sapi-04_SpeakFlags.tcl |
Test speaking flags of the CawtSapi package. |
Word-01_Basic.tcl |
Test basic functionality of the CawtWord package. |
Word-02_Table.tcl |
Test CawtWord procedures related to Word table management. |
Word-02_TableWidth.tcl |
Test CawtWord procedures related to Word table width management. |
Word-03_Text.tcl |
Test CawtWord procedures for handling text. |
Word-04_Find.tcl |
Test CawtWord procedures related to simple search and replace functionality. |
Word-04_FindGeneric.tcl |
Test CawtWord procedures related to generic search and replace functionality. |
Word-05_Report.tcl |
Test CawtWord procedures needed for generating a test report. |
Word-06_Diff.tcl |
Test CawtWord procedure for diff'ing Word files. |
Word-07_Link.tcl |
Test CawtWord procedures for handling links and inserting files. |
Word-08_ImgUtil.tcl |
Test CawtWord procedures for dealing with images. |
Word-09_Controls.tcl |
Test CawtWord procedures for handling content controls. |
Word-10_Properties.tcl |
Test CawtWord procedures related to property handling. |
Word-11_Tables.tcl |
Test CawtWord procedures related to Word table management. |
Word-12_LargeTable.tcl |
Test CawtWord procedures to insert a large Word table. |
Word-13_MultiTables.tcl |
Test CawtWord procedures to insert multiple Word tables across multiple pages. |
Word-14_Quit.tcl |
Test quitting Word without saving modified documents. |
Word-15_MergeCells.tcl |
Test CawtWord procedures related to Word table cell merging. |
Word-16_ReplaceImages.tcl |
Test CawtWord procedures for replacing images stored as InlinesShapes and Shapes. |
Word-17_Subdocuments.tcl |
Test CawtWord procedures related to subdocument handling. |
Word-18_PageSetup.tcl |
Test Word page setup setter and getter procedures. |
Word-19_Heading.tcl |
Test CawtWord procedures related to Word headings. |
Word-19_HeadingDict.tcl |
Test CawtWord procedures related to Word headings. |
Word-20_Font.tcl |
Test CawtWord procedures for handling fonts. |
Word-21_RunMacro.tcl |
Test CawtOffice procedures to run a macro contained in a Word file. |
Word-22_Events.tcl |
Test event handling functionality of Word. |
Word-23_Embed.tcl |
Test CawtWord procedures for embedding a Word document into a Tk frame. |
Table 14: Test Programs
The CAWT sub-packages have been tested successfully with the above-mentioned programs on the following operating systems and COM application versions:
Package |
Operating system |
Application version |
CawtEarth |
Windows 7, 8, 10 |
6.2, 7.1.2 |
CawtExcel |
Windows 7, 8, 10, 11 |
2013, 2016, 2019 (*) |
CawtExplorer |
Windows 7, 8 (**) |
IE 8, IE 9, IE 11 |
CawtMatlab |
Windows 7 |
R2007b |
CawtOcr |
Windows 7, 8 |
2013 |
CawtOneNote |
Windows 7, 8, 10, 11 |
2013, 2016 |
CawtOutlook |
Windows 7, 8, 10, 11 |
2013, 2016, 2019 (*) |
CawtPpt |
Windows 7, 8, 10, 11 |
2013, 2016, 2019 (*) |
CawtReader |
Windows 7, 8, 10 |
DC |
CawtSapi |
Windows 8, 10 |
5.3, 5.4 |
CawtWord |
Windows 7, 8, 10, 11 |
2013, 2016, 2019 (*) |
(*) Older Office versions may work, but are not tested anymore.
(**) See chapter 2.5 CawtExplorer: Automation for Internet Explorer for known issues with Internet Explorer on Windows 7 and 8.
To execute a single test program, execute it with the Tcl shell:
> tclsh Excel-02_Misc.tcl
To execute all test programs of a sub-package, use the utility script RunTest.tcl:
> tclsh RunTest.tcl Excel
To execute all test programs of CAWT, use the batch program RunTests.bat:
> RunTests.bat
Each test program accepts an optional string parameter. If this parameter is set to auto, the test program closes and quits the controlled application. If this parameter is not set, the controlled application stays open, so the results can be viewed directly in the application window.
The RunTest.tcl utility script, calls all test programs available for a sub-package by specifying the corresponding namespace name. The test programs are called with the above mentioned auto parameter. Additionally, the script can be supplied with optional parameters to switch off either the tests or to switch off the code coverage checks.
If called without any parameters, the script issues a help message onto standard output.
Usage: RunTest.tcl [Options] Namespace [Namespace]
Run the test programs and code coverage checks for specified namespace(s).
Namespaces usable: Cawt Excel Ppt Word OneNote Outlook Sapi Ocr Reader Earth Matlab Explorer.
Options:
--help : Display this usage message and exit.
--verbose: Show the detailed results of the tests. (Default: No)
--notests: Do not run the tests. (Default: Run tests)
--nocover: Do not run the coverage checks. (Default: Run coverage)
The information in this chapter is for programmers, who want to extend and improve CAWT.
Download the developer distribution from the CAWT homepage or checkout the source code from SourceForge. This distribution contains in addition to the user distribution the documentation source files (a Word and a PowerPoint file), as well as some additional utility scripts.
Create or update Office enumeration values
The files containing common Office enumerations (officeConst.tcl) as well as the enumeration values of the Office applications Excel (excelConst.tcl), PowerPoint (pptConst.tcl), Word (wordConst.tcl), Outlook (outlookConst.tcl) and SAPI (sapiConst.tcl) are automatically generated with script createConstFile.tcl.
The enumeration values of the current CAWT distribution are based on Microsoft Office 2019. If you have a newer Office version and want to update the enumeration files, execute the batch program createConstFiles.bat, which is located at the root directory of CAWT. Before calling the batch program, you should edit it to fit the locations of your Office programs.
Create or update CAWT documentation
The CAWT documentation comes in 2 parts, the user manual (this document) and a reference manual.
The reference manual is created with the help of the Ruff! package from inline documentation. So, if adding new procedures to the CAWT packages, be sure to also update the inline documentation.
The sources of the user manual are a Word template document and a PowerPoint presentation located in folder Documents/UserManual.
The final documentation is created by Tcl script genCawtDoc.tcl, which first creates the reference manual by calling Ruff!, and then the user manual.
The user manual is generated by exporting the slides of the presentation and inserting them into a copy of the Word template document. Additionally, a list of test scripts and tables of all CAWT procedures (containing links to the reference manual) are inserted. Finally, some keywords representing the current date, year and CAWT version are replaced with their corresponding values. The final user manual document is then written in Word and PDF format into folder Documents/Final.
Figure 12: Documentation generation workflow
If specifying the strings ref or user as command line parameter for script genCawtDoc.tcl, only the reference manual resp. the user manual is generated.
Create a CAWT distribution
To create a distribution (both user and developer), call Tcl script makeDist.tcl.
Note, that you should have updated the documentation before creating a distribution.
The location of the distribution output files and the program to create ZIP files are listed at the top of file makeDist.tcl, and must be adapted to your local situation.
The following table gives an overview of the release history of CAWT and its predecessors TcomOffice and TcomExcel.
Version |
Date |
Release notes |
TcomExcel |
||
0.1 |
2008-09-11 |
Initial release. Support for Excel 2000 and 2003. |
0.2 |
2009-09-19 |
Extended functionality. Added support for Excel 2007. |
0.3 |
2010-10-29 |
Bug fixes and extended test programs. |
0.3.1 |
2011-01-13 |
Extended functionality. Added support for Excel 2010. |
0.3.2 |
2011-04-05 |
Extended functionality. |
TcomOffice |
||
0.4.0 |
2011-07-17 |
New module TcomWord for Word automation. |
0.4.1 |
2011-08-28 |
Extended functionality. |
CAWT |
||
1.0.0 |
2012-12-23 |
Replaced Tcom with Twapi for COM access. Added support for PowerPoint, Internet Explorer, Google Earth and Matlab. Added user and reference manual. Unification of procedure names. Supports Microsoft Office versions 2003, 2007, 2010. |
1.0.1 |
2013-04-28 |
Extended Excel chart generation. Updated Twapi version to 4.0a16. Added support to generate a CAWT starkit. |
1.0.2 |
2013-07-28 |
Updated Twapi version to 4.0b22. Updated Img version to 1.4.1. Added new module CawtOcr. New procedures in CawtCore:
New procedures in CawtExcel:
|
1.0.3 |
2013-08-30 |
New procedures in CawtExcel:
|
1.0.4 |
2013-11-23 |
Improved test suite. Added support for Office 2013. Added support for 64-bit Office. Updated Img extension to version 1.4.2 (32-bit and 64-bit). Update Tablelist to version 5.10. New procedures in CawtWord:
New procedures in CawtExcel:
|
1.0.5 |
2014-01-26 |
New procedures in CawtExcel:
|
1.0.6 |
2014-04-21 |
Improved and extended test suite. Updated Twapi version to 4.0b53 to fix a bug with sparse matrices as well as core dumps with Word 2013. Improved and corrected handling of sparse matrices in Excel. Bug fix in excelCsv module. Possible incompatibility in GetRowValues and GetColumnValues: Changed startRow resp. startCol to default value 0 instead of 1. New procedures in CawtExcel:
|
1.0.7
|
2014-06-14 |
Updated Twapi version to official 4.0.61. CawtExcel:
CawtPpt:
Extended test suite for changed and new procedures. New procedures in CawtCore:
New procedures in CawtExcel:
New procedures in CawtPpt:
|
1.1.0 |
2014-08-30 |
Compatibility issue:
New module CawtOutlook to control Microsoft Outlook applications:
Extended test suite for changed and new procedures. New procedures in CawtExcel:
New procedures in CawtWord:
|
1.2.0 |
2014-12-14 |
Compatibility issue:
CawtExcel:
Extended test suite for changed and new procedures. New procedures in CawtWord:
|
2.0.0 |
2015-03-31 |
Ensembled all CAWT namespaces, ex. write "Excel Open" instead of "::Excel::Open". All Office enumerations are stored in module specific hash tables, ex. write "xlThick" instead of "$::Excel::xlThick". Updated and extended user manual (automatic insertion of CAWT procedure reference list). Added new application EnumExplorer.tcl to display Office enumerations. New module excelHtml.tcl for HTML export of Excel tables. External packages:
CawtExcel:
CawtWord:
New procedures in CawtCore:
New procedures in CawtExcel:
New procedures in CawtWord:
|
2.1.0 |
2015-09-01 |
Updated Twapi to version 4.2.a1, because of new Twapi functionality "tclcast bstr" and bug fix to retrieve document properties. Added support to generate a CAWT starpack. CawtExcel:
CawtPpt:
New procedures in CawtCore:
New procedures in CawtExcel:
New procedures in CawtPpt:
New procedures in CawtWord:
|
2.1.1 |
2015-10-31 |
Support for Office 2016.
External packages:
|
2.1.2 |
2015-11-10 |
Extended support for Excel page setup. Changed all Office procedures with size parameters to accept inches, centimeters or points.
CawtExcel:
New procedures in CawtCore:
New procedures in CawtExcel:
|
2.2.0 |
2015-12-12 |
Enhanced functionality in Core and Office modules.
Compatibility issue:
New module CawtOffice:
CawtCore:
CawtExcel:
New procedures in CawtCore:
New procedures in CawtExcel:
New procedures in CawtPpt:
New procedures in CawtWord:
|
2.3.0 |
2016-08-16 |
New module CawtOneNote.
Compatibility issue:
CawtOneNote:
New procedures in CawtExcel:
New procedures in CawtOutlook:
External packages:
|
2.3.1 |
2016-12-10 |
Enhanced functionality in Core and Office modules.
CawtExcel:
New procedures in CawtCore:
New procedures in CawtExcel:
New procedures in CawtWord:
External packages:
|
2.4.0 |
2017-06-18 |
New module CawtReader.
Compatibility issue:
CawtReader:
CawtExcel:
New procedures in CawtWord:
External packages:
|
2.4.1 |
2017-12-30 |
Enhanced functionality in Outlook module.
CawtOutlook:
CawtExcel:
New procedures in CawtExcel:
New procedures in CawtWord:
External packages:
|
2.4.2 |
2018-04-26 |
Enhanced functionality in several modules.
CawtPpt:
CawtWord:
New procedures in CawtExcel:
New procedures in CawtPpt:
New procedures in CawtWord:
|
2.4.3 |
2018-12-27 |
Support for Office 2019.
CawtOffice:
CawtWord:
New procedure in CawtOffice:
New procedure in CawtExcel:
New procedures in CawtPpt:
New procedures in CawtWord:
External packages:
|
2.4.4 |
2019-06-08 |
Enhanced functionality in several modules.
CawtCore:
CawtExcel:
New procedure in CawtExcel:
New procedures in CawtWord:
External packages:
|
2.4.5 |
2019-08-13 |
Enhanced functionality in Word module.
CawtWord:
New procedures in CawtWord:
External packages:
|
2.4.6 |
2019-10-12 |
Enhanced reference documentation.
CawtCore:
Office modules:
CawtPpt:
New procedures in CawtPpt:
External packages:
|
2.4.7 |
2019-11-03 |
Enhanced functionality in Ppt and Word modules.
CawtPpt:
New procedures in CawtPpt:
New procedures in CawtWord:
|
2.4.8 |
2020-03-08 |
Support for Office macro execution.
CawtExcel:
CawtWord:
New procedures in CawtCore:
New procedures in CawtOffice:
New procedures in CawtExcel:
New procedures in CawtWord:
|
2.4.9 |
2020-06-09 |
Enhanced functionality in Excel module
All modules:
CawtExcel:
New procedures in CawtExcel:
|
2.5.0 |
2020-07-24 |
Enhanced functionality for handling Office document properties.
CawtOffice:
New procedures in CawtOffice:
|
2.6.0 |
2021-01-06 |
New module CawtSapi adding support for Microsoft Speech API.
New procedures in CawtCore: · SetEventCallback
External packages: · Updated Twapi to version 4.5.2. · Updated Tablelist to version 6.11. · Updated tDOM to version 0.9.2. · Updated Img to version 1.4.12. |
2.7.0 |
2021-02-27 |
Enhanced functionality for handling Outlook contacts.
CawtCore: · Extended procedure CountWords to additionally sort by increasing or decreasing counts.
CawtExcel: · Changes in procedure WorksheetToTablelist: Improved speed when handling worksheets with large number of columns. Tablelist column headers are labeled like in Excel: A, B, C. Added options -header, -rownumber, -maxrows, -maxcols.
CawtWord: · Extended GetHyperlinksAsDict to be used as a coroutine.
New procedures in CawtOutlook: · AddContact, AddContactFolder, DeleteContactByIndex, · DeleteContactFolder, GetContactByIndex, · GetContactFolderId, GetContactFolderNames, · GetContactProperties, GetNumContactFolders, · GetContactReadOnlyPropertyNames, · GetContactReadWritePropertyNames, · GetNumContacts, HaveContactFolder, · SetContactProperties
New procedures in CawtPpt: · GetNumSlideImages, GetNumSlideVideos, · GetSlideIdByName, GetSlideImages, GetSlideName, · GetSlideVideos, SetSlideName
New procedures in CawtWord: · GetBookmarkNames, GetHyperlinksAsDict, · PrintHyperlinkDict, GetNumHyperlinks
External packages: · Updated Tablelist to version 6.12. · Updated Ruff! to version 1.1. |
2.8.0 |
2021-06-27 |
Added functionality for embedding applications.
CawtExcel: · Extended procedure OpenWorkbook to embed the application into a Tk frame.
CawtPpt: · Extended procedure OpenPres to embed the application into a Tk frame.
CawtReader: · Extended procedure Open to embed the application into a Tk frame.
CawtWord: · Extended procedure OpenDocument to embed the application into a Tk frame.
New procedures in CawtCore: · EmbedApp
New procedures in CawtExcel: · GetNumStyles, GetStyleId
New procedures in CawtWord: · GetNumPages, SetViewParameters
External packages: · Updated Tablelist to version 6.14. · Updated Ruff! to version 1.2. |
2.8.1 |
2021-07-22 |
Maintenance release.
CawtExcel: · Added automatic mapping of worksheet names to Excel constraints regarding invalid characters and maximum length.
CawtWord: · Corrected behaviour of GetHyperlinksAsDict, if link points to an invalid domain. |
2.8.2 |
2021-08-20 |
Maintenance release.
CawtWord: · Corrected behaviour of GetHyperlinksAsDict, if link points to an URL with spaces. · Extended SetTableOptions with new option -width. · Extended SetColumnWidth to specify width in percent. |
2.9.0 |
2021-12-19 |
Added functionality for interpolation curves.
CawtCore: · Added oo:class to interpolate between control points.
CawtWord: · GetHyperlinksAsDict: o Improved speed of URL validity check. o Added support for URL's with subaddress (ex. www.tcl3d.org/doc.html#Index).
New procedures in CawtCore: · IsValidUrlAddress, SetClipboardWaitTime, · WaitClipboardReady
New procedures in CawtPpt: · IsValidPresId, GetCurrentSlideIndex
External packages: · Updated Ruff! to version 2.0. · Updated Tablelist to version 6.16. · Updated Twapi to version 4.6.0. |
2.9.1 |
2022-04-09 |
Maintenance release.
CawtExcel: · Added option "-selection" to procedure WorksheetToTablelist to transfer the selected Excel cell range. · Corrected regexp in procedures GetRangeAsIndex and GetCellValueA1.
CawtOutlook: · Improved GetFoldersRecursive.
New procedures in CawtWord: · GetHeadingsAsDict, PrintHeadingDict |
2.9.2 |
2022-12-21 |
Maintenance release.
CawtWord: · Extended SetTableName and GetTableName to specify or retrieve the descriptive table text.
Test programs and documentation: · Corrected links due to new Ruff! version. |
2.9.3 |
2023-03-20 |
Maintenance release.
CawtExcel: · Corrected default value of parameter worksheetNameOrIndex from 0 to 1 in procedures ExcelFileToWikitFile and ExcelFileToMediaWikiFile. · Added test script showing how to export an Excel workbook as Wikit tables with hyperlinks.
CawtWord: · Extended validity detection of sub-addresses in procedure GetHyperlinksAsDict to include <a id=”XXX”> in addition to <a name=”XXX”> addresses.
New procedures in CawtPpt: · GetCommentKeyLeftPosition, GetCommentKeyPosition
External packages: · Updated Img to version 1.4.14. · Updated Ruff! to version 2.3.0. · Updated Tablelist to version 6.20. · Updated tDOM to version 0.9.3. · Updated Twapi to version 4.7.2. |
2.9.4 |
2023-07-17 |
Maintenance release.
CawtWord: · Extended validity detection of sub-addresses in procedure GetHyperlinksAsDict to include <a id='XXX'> and <a name='XXX'> addresses. |
2.9.5 |
2024-03-12 |
Maintenance release.
CawtCore: · Take care of changed Img behaviour in procedure ImgToClipboard: · Img 2.0 returns image data as binary string. · Img 1.4 returns image data as base64 encoded string.
CawtOutlook: · Added new options "-requiredattendees" and "-optionalattendees" to procedures GetAppointmentProperties and AddAppointment. |
2.9.6 |
2024-06-13 |
Maintenance release.
All modules: · Added support for Tcl 9. · Added support for Twapi 5.
New procedures in CawtExcel: · GetListItemSeparator, SetListItemSeparator. |
3.0.0 |
2024-12-08 |
Major release with full Tcl9 support.
· More Tcl9 changes detected with tcl9-migrate tool. · Removed possible errors detected by Nagelfar. · Removed obsolete base64 package. Used "binary decode" instead. · Removed external packages and starkits. Use a BAWT Tcl-BI distribution for external packages.
CawtCore: · Corrrected OfficeDate conversions.
CawtOffice: · Updated enumerations and version strings for Office 2019.
CawtExcel: · Added new format option "display" to procedure GetCellValue. |
3.1.0 |
2025-01-29 |
Added new Outlook functionality.
CawtOutlook: · Added new module for handling Outlook accounts. · Added options "-account" and “-onbehalf” to procedure SendMail.
Test programs: · Delete directory testOut after test execution. · Added option "--nodelete" to disable deletion.
Removed obsolete procedures: · Cawt::IsValidId (use Cawt::IsComObject instead) · Cawt::OutlookDateToSeconds (use Cawt::OfficeDateToSeconds instead) · Cawt::SecondsToOutlookDate (use Cawt::SecondsToOfficeDate instead) · Cawt::OutlookDateToIsoDate (use Cawt::OfficeDateToIsoDate instead) · Cawt::IsoDateToOutlookDate (use Cawt::IsoDateToOfficeDate instead) · Excel::GetFloatSeparator (use Excel::GetDecimalSeparator instead) · Excel::GetLangNumberFormat (use Excel::GetNumberFormat instead) · Excel::ChartToClipboard (use Excel::ChartObjToClipboard instead) · Excel::SaveChartAsImage (use Excel::SaveChartObjAsImage instead) · Excel::SetChartSize (use Excel::SetChartObjSize instead) · Office::RgbToColor (use Cawt::RgbToOfficeColor instead) · Office::ColorToRgb (use Cawt::OfficeColorToRgb instead) · Office::ShowAlerts (use modules specific ShowAlerts instead) · Outlook::OpenNew (use Outlook::Open instead) |
3.1.1 |
2025-07-10 |
Maintenance release.
CawtExcel: · Adapted clipboard management to changed TWAPI 5.1 behaviour. · Some minor fixes. |
This chapter contains lists of figures, tables and terms and abbreviations.
Figure 1: Overview of CAWT packages
Figure 3: Module excelTablelist
Figure 4: Module excelMatlabFile
Figure 7: Module excelMediaWiki
Figure 10: Screenshot of EnumExplorer.tcl
Figure 11: Auto-generated Outlook mail from OneNoteInfo.tcl
Figure 12: Documentation generation workflow
Table 5: CawtExplorer Reference
Table 8: CawtOneNote Reference
Table 9: CawtOutlook Reference
Table 11: CawtReader Reference
Term / Abbreviation |
Meaning |
API |
Application Program Interface |
BAWT |
Build Automation With Tcl |
BSD |
Berkeley Software Distribution |
CAWT |
COM Automation With Tcl |
COM |
Component Object Model |
CSV |
Comma Separated Values |
DOM |
Document Object Model |
GUI |
Graphical User Interface |
HTML |
Hypertext Markup Language |
ISO |
International Organization for Standardization |
OCR |
Optical Character Recognition |
|
Portable Document Format |
RGB |
Red-Green-Blue |
SAPI |
Speech Application Programming Interface |
Tcl |
Tool Command Language |
Tk |
Toolkit |
URL |
Uniform Resource Locator |
UTF |
Unicode Transformation Format |
XML |
Extensible Markup Language |