![]() |
#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 |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro on Search and Replace | davidhuy | Word VBA | 1 | 12-19-2014 04:47 AM |
![]() |
dirkoo | Word VBA | 2 | 08-14-2013 11:25 AM |
![]() |
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 |