For Programmers: Free Programming Magazines  


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

Miko

2005-07-26, 4:07 am

Hi,
look at:
http://mini.net/tcl/4472
and:
http://mini.net/tcl/1821

VBA help is also useful...

Miko


am

2005-07-29, 9:05 am

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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com