Copying text between two bookmarks

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi -

I want to copy text between two bookmarks so I can modify formatting
(specifically, remove all tabs). I can't figure out how to do this. I can
search and find the first bookmark, but can't figure out how to start
copying/blocking text and get to the 2nd one. I'm using Word 2003.

Thanks in advance for taking the time to reply.

Shirley
 
Shirley said:
Hi -

I want to copy text between two bookmarks so I can modify formatting
(specifically, remove all tabs). I can't figure out how to do this.
I can search and find the first bookmark, but can't figure out how to
start copying/blocking text and get to the 2nd one. I'm using Word
2003.

Thanks in advance for taking the time to reply.

Shirley

Hi Shirley,

To use just regular dialogs, follow these steps:

- Edit > GoTo (or Ctrl+G) > Bookmark > select starting bookmark
- Click "Go To", then click Close
- Press F8 to turn on Extend mode
- Edit > GoTo (or Ctrl+G) > Bookmark > select stopping bookmark
- Click "Go To", then click Close
- Use Edit > Replace with ^t in the Find What box and nothing in the Replace
With box; click Replace All; answer No when asked whether to continue

To do it with a macro, try this (with the appropriate bookmark names):

Sub RemoveTabsBetweenBookmarks()
Dim myRange As Range

Set myRange = _
ActiveDocument.Bookmarks("start").Range
myRange.End = _
ActiveDocument.Bookmarks("stop").Range.Start

With myRange.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "^t"
.Replacement.Text = ""
.Format = False
.Forward = True
.Wrap = wdFindStop
.Execute Replace:=wdReplaceAll
End With
End Sub

For repeated use, modify the macro to accept the bookmark names in InputBox
statements.
 
Dear Jay,

Thank you SO much! I had no idea that's what F8 did. This is exactly what
I needed.

Again, my thanks. And you were so quick too :)

Regards,
Shirley
 
Back
Top