Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Automatically changing text when another text is changed | Microsoft Word Help | |||
Disable locks on text in text block tool? | Microsoft Word Help | |||
How do I remove a text box without removing the text from the doc. | Microsoft Word Help | |||
Text Form Field Ref in Footer Won't Update on Screen | Microsoft Word Help | |||
How to protect bookmarks | Microsoft Word Help |