Using Dynamic data Exchange (DDE)
|
|
See http://dev.scriptics.com/man/tcl8.3/TclCmd/dde.htm for more on the dde package included in Tcl starting with version 8.1.
From a posting by Bill Schongar, at http://www.deja.com/=dnc/getdoc.xp?AN=490725194, you can control Microsoft Word from the
dde command. First. be sure Word is running, then try a command like the following to insert text into the current document:
package require dde
dde execute -async Winword System {[Insert "Text from Tcl."]}
To quit Word, or close a document, use the following commands as a guide:
dde execute Winword System {[FileExit 2]}
dde execute Winword System {[FileClose 2]}
In these examples, 2 = close without saving, 1 = save first, 0 = prompt.
For documentation on accessing Word, see the "wrdbasic.hlp" file, which you can choose to install when you install Word.
|
|
|