Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-26-2012, 12:09 PM
maceslin maceslin is offline How to stop a macro Windows 2K How to stop a macro Office 2007
Novice
How to stop a macro
 
Join Date: Jul 2012
Posts: 8
maceslin is on a distinguished road
Default How to stop a macro

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
Thanks for lookin'
Dave
Reply With Quote
  #2  
Old 07-26-2012, 03:38 PM
macropod's Avatar
macropod macropod is offline How to stop a macro Windows 7 64bit How to stop a macro Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #3  
Old 07-27-2012, 04:38 AM
maceslin maceslin is offline How to stop a macro Windows 2K How to stop a macro Office 2007
Novice
How to stop a macro
 
Join Date: Jul 2012
Posts: 8
maceslin is on a distinguished road
Default

Quick style was the way to go

Thanks
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to stop a macro 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 a macro 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

Other Forums: Access Forums

All times are GMT -7. The time now is 08:23 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft