Thread: [Solved] Reverse Bold macro
View Single Post
 
Old 02-25-2016, 06:28 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,365
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

Quote:
Originally Posted by gmaxey View Post
Paul's code seems fast to me. The only possible issue with it is that it pukes if your selection happens to include the final paragraph mark.
Thanks for the heads-up. That could be remedied by replacing:
Set Rng = Selection.Characters.First
with:
Code:
With Selection
  Set Rng = .Characters.First
  If .End = ActiveDocument.Range.End Then
    .Characters.Last.Font.Bold = Not .Characters.Last.Font.Bold
    .End = .End - 1
  End If
End With
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote