![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Microsoft Office support MS Office support forum |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#2 (permalink) |
|
Registered User
Join Date: May 2008
Location: Baltimore, Maryland
Posts: 159
OS: Windows XP SP3
|
Re: Macro for Word
Here is some code I threw together quickly. It underlines words contained within quotation marks. The code could use a little work, though, so go ahead and make improvements as you see fit!
Code:
Sub Underline()
Dim idx As Long
Do While idx < ActiveDocument.Words.Count
idx = idx + 1
Select Case Trim(ActiveDocument.Words(idx))
Case Chr(147), Chr(148), Chr(34)
If Not ((idx + 2) > ActiveDocument.Words.Count) Then
Select Case Trim(ActiveDocument.Words(idx + 2))
Case Chr(147), Chr(148), Chr(34)
ActiveDocument.Words(idx + 1).Underline = wdUnderlineSingle
idx = idx + 1
End Select
End If
End Select
Loop
End Sub
|
|
|
|
![]() |
| Thread Tools | |
|
|