Reply
 
Thread Tools Display Modes
  #1   Report Post  
Shirley Hommel
 
Posts: n/a
Default Copying text between two bookmarks

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
  #2   Report Post  
Jay Freedman
 
Posts: n/a
Default

Shirley Hommel wrote:
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.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org


  #3   Report Post  
Shirley Hommel
 
Posts: n/a
Default

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

"Jay Freedman" wrote:

Shirley Hommel wrote:
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.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically changing text when another text is changed Melissa S Microsoft Word Help 1 December 29th 04 08:43 PM
Disable locks on text in text block tool? Joan Ramsay Microsoft Word Help 1 December 25th 04 02:22 AM
How do I remove a text box without removing the text from the doc. NormaJean Microsoft Word Help 2 December 13th 04 05:25 PM
Text Form Field Ref in Footer Won't Update on Screen StarWine Microsoft Word Help 3 December 6th 04 06:17 PM
How to protect bookmarks Flip Microsoft Word Help 6 November 30th 04 12:38 PM


All times are GMT +1. The time now is 05:02 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"