Home > Archive > Tcl > July 2005 > Writing to a word document Bookmark
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Writing to a word document Bookmark
|
|
| yegua22@gmail.com 2005-07-25, 9:34 am |
| I have searched the internet and I cannot seem to find any good
examples on how to write to word. Basically I have a word document
with bookmarks in it. WHat I want my tcl program to be able to do is
put text into each bookmark, depending on the bookmark name. Is this
possible? I have tried for examples using both dde and tcom but I am
getting no where.
Thanks
Jeremy
| |
|
|
|
| yegua22@gmail.com wrote:
> I have searched the internet and I cannot seem to find any good
> examples on how to write to word. Basically I have a word document
> with bookmarks in it. WHat I want my tcl program to be able to do is
> put text into each bookmark, depending on the bookmark name. Is this
> possible? I have tried for examples using both dde and tcom but I am
> getting no where.
>
> Thanks
> Jeremy
Use the ascii-form of a word-document : RTF RichTextFormat
As Bookmark use normal text like PRINT_NAME , PRINT_BIRTHDATE
then you can do a search and replace.
regsub is simple, but only sufficient if you only have a very smal number of
replacements and the rtf-file is small.
the fastest way for me is an invisible textwidget
...
set idx [.textwidget search -forward PRINT_ 1.0 end]
while {[string length $idx]} {
Mit freundlichen Grüßen
Albrecht Mucha
Software Entwicklung
----------------------------------------------------------------------
MediTec GmbH
IT-Lösungen für das Gesundheitswesen
Griesbergstr. 1b-c eMail : [string map {X {}} a.Xmucha@Xmeditec-gmbh.com]
31162 Bad Salzdetfurth Internet : www.meditec-gmbh.com
|
|
|
|
|