overwrite text but keep bookmarks

E

Erik

Hi VBA guru's,

I have an Access form in which users can fill in text in textboxes.
when a user exits the textbox (after_update event) I want this text to
appear in a bookmark on a Word document. This works fine, but if a user
wants to change the contents of a particular textbox (and therefore the
specific text on the Word document) the new text must replace the old
text in the document. But it removes the bookmark when I placed the
text (through VBA code) and if I (using the bookmark range) put the
bookmark back in place and enter new text it appends it to the end of
the old text instead of overwriting it.

Does anyone has any idea or even code samples of how to do this?

I appreciate your help very much.

greetings,

Erik.
 
J

Jonathan West

Erik said:
Hi VBA guru's,

I have an Access form in which users can fill in text in textboxes.
when a user exits the textbox (after_update event) I want this text to
appear in a bookmark on a Word document. This works fine, but if a user
wants to change the contents of a particular textbox (and therefore the
specific text on the Word document) the new text must replace the old
text in the document. But it removes the bookmark when I placed the
text (through VBA code) and if I (using the bookmark range) put the
bookmark back in place and enter new text it appends it to the end of
the old text instead of overwriting it.

Does anyone has any idea or even code samples of how to do this?

I appreciate your help very much.

greetings,

Erik.

Hi Erik

Take a look here

Inserting text at a bookmark without deleting the bookmark
http://www.word.mvps.org/FAQs/MacrosVBA/InsertingTextAtBookmark.htm


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top