![]() |
|
|
|
#1
|
|||
|
|||
|
I have a long document with many url's. I want to make all of the url's italic. Is there a way to search and replace all using wildcards or some other feature? |
|
#2
|
|||
|
|||
|
If the URLs have been styled as Hyperlinks, something that Word intermittently manages by itself, then all you need to do is update the Hyperlink character style.
|
|
#3
|
|||
|
|||
|
That worked even better than the wildcard method I was trying out. Is there also way to remove all the hyperlinks at one time (getting this document ready for InDesign)? Thanks.
|
|
#4
|
||||
|
||||
|
The following macro will unlink all hyperlinks to leave the display text:
Code:
Sub UnlinkHLinks()
Dim oStory As Range
Dim oFld As field
For Each oStory In ActiveDocument.StoryRanges
For Each oFld In oStory.Fields
If oFld.Type = wdFieldHyperlink Then
oFld.Unlink
End If
Next oFld
If oStory.StoryType <> wdMainTextStory Then
While Not (oStory.NextStoryRange Is Nothing)
Set oStory = oStory.NextStoryRange
For Each oFld In oStory.Fields
If oFld.Type = wdFieldHyperlink Then
oFld.Unlink
End If
Next oFld
Wend
End If
Next oStory
Set oStory = Nothing
lbl_Exit:
Set oStory = Nothing
Set oFld = Nothing
Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Macro on Search and Replace | davidhuy | Word VBA | 1 | 12-19-2014 04:47 AM |
search and replace
|
dirkoo | Word VBA | 2 | 08-14-2013 11:25 AM |
Odd search and replace query
|
Rabski | Word | 1 | 11-13-2012 02:25 PM |
| Search Replace Copy | dblack7211 | Word | 0 | 05-05-2010 01:19 PM |
| Search and Replace - Clear Search box | JostClan | Word | 1 | 05-04-2010 08:46 PM |