update a word-bookmark with the win32.com extension

Bob Gailer bgailer at alum.rpi.edu
Sat Nov 22 18:33:02 EST 2003


At 06:42 AM 11/18/2003, Christian Lehmann wrote:

>Hello,
>
>I want to update a bookmark in a word file.
>My code looks like this:
>
>def UpdateBookmark(BookmarkToUpdate, TextToUse):
>     FieldRange = Document.Bookmarks(BookmarkToUpdate).Range
>     FieldRange.Text = TextToUse        # error message
>     ActiveDocument.Bookmarks.Add(BookmarkToUpdate,FieldRange)
>
>
>UpdateBookmark ("Bookmarkname","newString")
>
>
>when i assign the new string an error message occurs.

Please include the error message in your postings.

Bob Gailer
bgailer at alum.rpi.edu
303 442 2625
-------------- next part --------------

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.538 / Virus Database: 333 - Release Date: 11/10/2003


More information about the Python-list mailing list