![]() |
|
|
|
#1
|
|||
|
|||
|
I have created a macro to underline and change the color of the word(s) that I select using the macro builder. Macro works great when I execute but it will not "turn off", everything I type after highlighting my word(s) is in this format, it should only be the word(s) I select.
Here is the code Code:
Sub NWDCtextin()
'
' NWDCtextin Macro
'
'
Selection.Font.UnderlineColor = wdColorAutomatic
Selection.Font.Underline = wdUnderlineSingle
Selection.Font.Color = wdColorBlue
End Sub
Dave |
|
#2
|
||||
|
||||
|
Hi Dave,
That's because anything you type immediately after something that has a particular attribute inherits that attribute. If you leave a space after the selection before running the macro, all should be fine. BTW, the better way to do this would be to define a character Style with the attributes you want.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#3
|
|||
|
|||
|
Quick style was the way to go
Thanks |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Stop macro "IF"
|
coxjamd | Excel Programming | 2 | 03-01-2012 02:40 PM |
| Start and stop an executeble from vba | remmyMartin | Outlook | 0 | 01-12-2012 08:09 AM |
How to stop repaginating
|
ictodd | Word | 4 | 09-05-2011 02:57 AM |
| Video clip stop | pf36 | PowerPoint | 0 | 04-16-2010 07:29 AM |
| GIF's stop working | Kwarior | PowerPoint | 3 | 03-17-2010 09:59 PM |