![]() |
|
![]() |
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
![]()
Word 2016
I have a document with many hyperlinks in it. I want to convert the hyperlinked text into the actual url ,en masse and not one at a time. Is there a way to do this? |
#2
|
|||
|
|||
![]()
There is no word feature that does this. It will take a macro. I do not have one off the top of my head, but if you can run a macro on your system, I will write one for you.
|
#3
|
||||
|
||||
![]()
A macro would be required, but it's not clear what you want to do:
1. Convert URL texts to working hyperlinks; or 2. Convert working hyperlinks to URL texts. For 1: Code:
Sub ConvtHLkStrToHLnkFld() Application.ScreenUpdating = False Dim bHead As Boolean, bList As Boolean, bBullet As Boolean, bOther As Boolean, bQuote As Boolean Dim bSymbol As Boolean, bOrdinal As Boolean, bFraction As Boolean, bEmphasis As Boolean Dim bHLink As Boolean, bStyle As Boolean, bMail As Boolean, bTag As Boolean 'Get current autoformat options With Options bHead = .AutoFormatApplyHeadings bList = .AutoFormatApplyLists bBullet = .AutoFormatApplyBulletedLists bOther = .AutoFormatApplyOtherParas bQuote = .AutoFormatReplaceQuotes bSymbol = .AutoFormatReplaceSymbols bOrdinal = .AutoFormatReplaceOrdinals bFraction = .AutoFormatReplaceFractions bEmphasis = .AutoFormatReplacePlainTextEmphasis bHLink = .AutoFormatReplaceHyperlinks bStyle = .AutoFormatPreserveStyles bMail = .AutoFormatPlainTextWordMail bTag = .LabelSmartTags End With 'Restrict autoformat options to hyperlinks With Options .AutoFormatApplyHeadings = False .AutoFormatApplyLists = False .AutoFormatApplyBulletedLists = False .AutoFormatApplyOtherParas = False .AutoFormatReplaceQuotes = False .AutoFormatReplaceSymbols = False .AutoFormatReplaceOrdinals = False .AutoFormatReplaceFractions = False .AutoFormatReplacePlainTextEmphasis = False .AutoFormatReplaceHyperlinks = True .AutoFormatPreserveStyles = False .AutoFormatPlainTextWordMail = False .LabelSmartTags = False End With 'Apply autoformatting ActiveDocument.Range.AutoFormat 'Restore the original autoformat options With Options .AutoFormatApplyHeadings = bHead .AutoFormatApplyLists = bList .AutoFormatApplyBulletedLists = bBullet .AutoFormatApplyOtherParas = bOther .AutoFormatReplaceQuotes = bQuote .AutoFormatReplaceSymbols = bSymbol .AutoFormatReplaceOrdinals = bOrdinal .AutoFormatReplaceFractions = bFraction .AutoFormatReplacePlainTextEmphasis = bEmphasis .AutoFormatReplaceHyperlinks = bHLink .AutoFormatPreserveStyles = bStyle .AutoFormatPlainTextWordMail = bMail .LabelSmartTags = bTag End With Application.ScreenUpdating = True End Sub Code:
Sub ConvtHLkFldToHLnkStr() Dim i As Long With ActiveDocument For i = .Hyperlinks.Count To 1 Step -1 With .Hyperlinks(i) .Range.Text = .Address End With Next End With End Sub For Mac macro installation & usage instructions, see: Word:mac - Install a Macro
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
||||
|
||||
![]()
Cross-posted at: Convert many hyperlinks to the actual url, document-wide, not - Microsoft Community
For cross-posting etiquette, please read: Excelguru Help Site - A message to forum cross posters
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
![]()
Hi Paul, just wondering with option 1, is there any way to control autoformat configuration so that the hyperlinking is the only thing that it does?
In testing I've found that autoformat will also remove some paragraph marks (first run and second run only, third and subsequent runs produce no further change), but I'm not sure which rules are applied for them to be removed? I have Googled for Word autoformat rules but haven't been able to find anything I've attached a screenshot of a new blank document pre autoformat, post 1st run and post 2nd run that hopefully shows what I'm not understanding! Thanks Lee |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
njcloud | Mail Merge | 23 | 02-04-2020 02:00 PM |
Hyperlinks that Do Not Exist in the Original Word Document Appearing in the PDF Document | diarrheaofthewprocessor | Word | 11 | 01-24-2017 01:52 PM |
Convert Hyperlinks to ahref | dan88 | Word VBA | 2 | 05-09-2016 06:19 PM |
Persuade my company's marketing person to use an actual template instead of document | shansen | Word | 6 | 03-11-2014 07:09 AM |
MS Project able to import actual start and or actual finish date from Excel? | mhacker | Project | 0 | 04-26-2010 11:29 AM |