Advanced Search
Mail us
Home    Manuel    Links    Faq    Submit a tcl/tk Reference    Contact Us

    Some examples tcl/tk codes     Man of Bwidget     Man of blt     mkwidget screenshots     TkOgl     Video Demo real.

  Using Dynamic data Exchange (DDE)
 See for more on the dde package included in Tcl starting with version 8.1. 

From a posting by Bill Schongar, at, 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.