Delete text between two bookmarks

W

Word.user

Hi,
How to delete text between two bookmarks.
To get the text I am using:
vstring =
ActiveDocument.Range(ActiveDocument.Bookmarks("bookmark1").Range.Start,
ActiveDocument.Bookmarks("bookmark2").Range.End)

But I dont know how to delete it

Thanks in advance
 
R

Russ

Word,
Public Sub testdeleterange()
Dim aRange As Word.Range
Set aRange = ActiveDocument.Range( _
ActiveDocument.Bookmarks("bookmark1").Range.Start, _
ActiveDocument.Bookmarks("bookmark2").Range.End)
MsgBox aRange.Text
aRange.Delete
End Sub
 

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