Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.newusers
|
|||
|
|||
Find and Replace
Is there a way in the Find and Replace dialog box of telling Word to
underline a whole sentence but not the period following it? I know how to underline the sentence with the period, but somehow I'm having a mental block concerning leaving the period without an underline. Here's the unbelievable part: I have a function key assigned to this very thing, and it works every time! But I don't know whether I stumbled across a way to do it at some point or whether one of you wonderful people wrote a macro for it. No matter how it got there, I'd really like to know if Find and Replace alone can do it. Thank you so much for helping me to be a better word processor! |
#2
Posted to microsoft.public.word.newusers
|
|||
|
|||
Find and Replace
Somebody clever may come along and prove me wrong, but I don't think
Replace, even with wildcards, can do that trick. The reason is that the entire replacement can have only one value for each kind of formatting (underline, bold, etc.) -- there's no way to say "replace part of the found text with one kind of format and the rest with another kind". What you have to do is set things up so all the found text requires the same format. That takes at least two steps, so a macro is necessary. The macro doesn't have to use Find/Replace. For example, here's one that doesn't: Sub UnderlineSentence() Dim oRg As Range Set oRg = Selection.Sentences(1) With oRg .Collapse wdCollapseStart .MoveEndUntil cset:=".?!", Count:=wdForward .Underline = wdUnderlineSingle End With Set oRg = Nothing End Sub Put the cursor anywhere inside the desired sentence and run the macro. As for finding out what you already have: Go to Tools Customize Keyboard. Choose any command in the dialog, put the cursor in the "Press new shortcut key" box, and press the function key that's already assigned to your underlining function. The dialog will show "Currently assigned to:" followed by the name and location of the macro. Cancel out of the dialog without making any assignment. Then you can track down the macro and see what the code does. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. On Sun, 7 Jan 2007 13:10:00 -0800, Island Girl wrote: Is there a way in the Find and Replace dialog box of telling Word to underline a whole sentence but not the period following it? I know how to underline the sentence with the period, but somehow I'm having a mental block concerning leaving the period without an underline. Here's the unbelievable part: I have a function key assigned to this very thing, and it works every time! But I don't know whether I stumbled across a way to do it at some point or whether one of you wonderful people wrote a macro for it. No matter how it got there, I'd really like to know if Find and Replace alone can do it. Thank you so much for helping me to be a better word processor! |
#3
Posted to microsoft.public.word.newusers
|
|||
|
|||
Find and Replace
Hi, Jay:
Thanks so much for your usual great help. As a matter of fact, it could have been you who wrote the macro for me in the first place since, as you indicated, it couldn't have been a find and replace that I somehow stumbled upon. It certainly came in handy yesterday in a 182-page agreement in which the first subject matter line of each numbered paragraph was underlined. I really appreciate all the help you've given me in the past and now. And thanks to all the macros and find and replace goodies you and your fellow MVP's have provided me, my work gets easier each day. "Jay Freedman" wrote: Somebody clever may come along and prove me wrong, but I don't think Replace, even with wildcards, can do that trick. The reason is that the entire replacement can have only one value for each kind of formatting (underline, bold, etc.) -- there's no way to say "replace part of the found text with one kind of format and the rest with another kind". What you have to do is set things up so all the found text requires the same format. That takes at least two steps, so a macro is necessary. The macro doesn't have to use Find/Replace. For example, here's one that doesn't: Sub UnderlineSentence() Dim oRg As Range Set oRg = Selection.Sentences(1) With oRg .Collapse wdCollapseStart .MoveEndUntil cset:=".?!", Count:=wdForward .Underline = wdUnderlineSingle End With Set oRg = Nothing End Sub Put the cursor anywhere inside the desired sentence and run the macro. As for finding out what you already have: Go to Tools Customize Keyboard. Choose any command in the dialog, put the cursor in the "Press new shortcut key" box, and press the function key that's already assigned to your underlining function. The dialog will show "Currently assigned to:" followed by the name and location of the macro. Cancel out of the dialog without making any assignment. Then you can track down the macro and see what the code does. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. On Sun, 7 Jan 2007 13:10:00 -0800, Island Girl wrote: Is there a way in the Find and Replace dialog box of telling Word to underline a whole sentence but not the period following it? I know how to underline the sentence with the period, but somehow I'm having a mental block concerning leaving the period without an underline. Here's the unbelievable part: I have a function key assigned to this very thing, and it works every time! But I don't know whether I stumbled across a way to do it at some point or whether one of you wonderful people wrote a macro for it. No matter how it got there, I'd really like to know if Find and Replace alone can do it. Thank you so much for helping me to be a better word processor! |
#4
Posted to microsoft.public.word.newusers
|
|||
|
|||
Find and Replace
:-)
You're welcome! -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. Island Girl wrote: Hi, Jay: Thanks so much for your usual great help. As a matter of fact, it could have been you who wrote the macro for me in the first place since, as you indicated, it couldn't have been a find and replace that I somehow stumbled upon. It certainly came in handy yesterday in a 182-page agreement in which the first subject matter line of each numbered paragraph was underlined. I really appreciate all the help you've given me in the past and now. And thanks to all the macros and find and replace goodies you and your fellow MVP's have provided me, my work gets easier each day. "Jay Freedman" wrote: Somebody clever may come along and prove me wrong, but I don't think Replace, even with wildcards, can do that trick. The reason is that the entire replacement can have only one value for each kind of formatting (underline, bold, etc.) -- there's no way to say "replace part of the found text with one kind of format and the rest with another kind". What you have to do is set things up so all the found text requires the same format. That takes at least two steps, so a macro is necessary. The macro doesn't have to use Find/Replace. For example, here's one that doesn't: Sub UnderlineSentence() Dim oRg As Range Set oRg = Selection.Sentences(1) With oRg .Collapse wdCollapseStart .MoveEndUntil cset:=".?!", Count:=wdForward .Underline = wdUnderlineSingle End With Set oRg = Nothing End Sub Put the cursor anywhere inside the desired sentence and run the macro. As for finding out what you already have: Go to Tools Customize Keyboard. Choose any command in the dialog, put the cursor in the "Press new shortcut key" box, and press the function key that's already assigned to your underlining function. The dialog will show "Currently assigned to:" followed by the name and location of the macro. Cancel out of the dialog without making any assignment. Then you can track down the macro and see what the code does. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. On Sun, 7 Jan 2007 13:10:00 -0800, Island Girl wrote: Is there a way in the Find and Replace dialog box of telling Word to underline a whole sentence but not the period following it? I know how to underline the sentence with the period, but somehow I'm having a mental block concerning leaving the period without an underline. Here's the unbelievable part: I have a function key assigned to this very thing, and it works every time! But I don't know whether I stumbled across a way to do it at some point or whether one of you wonderful people wrote a macro for it. No matter how it got there, I'd really like to know if Find and Replace alone can do it. Thank you so much for helping me to be a better word processor! |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
find and replace all | Microsoft Word Help | |||
Find and Replace problems | Microsoft Word Help | |||
Problem with find and replace of paragragh marks | Microsoft Word Help | |||
Find and Replace GREEK symbols in XP, 2K & 97 | Microsoft Word Help | |||
Find and Replace anomaly | Microsoft Word Help |