deleting text with commando

S

Schorrie

Hi,

I have a template on which i make a new document,

is some cases, depending on choices given in the userform,

an amount of text should be deleted,

is there a command with which i can select a text between two bookmarks and
delete that text,

thanks, schorrie
 
S

Schorrie

hi,

the problem is that it is a text with several bookmarks already in it,

depending on a little choice in the userform, all of the text should
disappear and be replaced by one little sentence;

thx schorrie
 
D

Doug Robbins - Word MVP

Hi Schorrie,

A bookmark can include text in which other bookmarks are also located.

If you want to replace the text with something else, use

ActiveDocument.Bookmarks("BMName").Range.Text = "That little sentence."

Note, that will destroy the bookmark. If you want to retain the bookmark,
see the article “Inserting text at a bookmark without deleting the bookmark”
at:

http://www.mvps.org/word/FAQs/MacrosVBA/InsertingTextAtBookmark.htm

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

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