Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-24-2020, 07:32 AM
enso enso is offline Convert many hyperlinks to the actual url, document-wide, not individually Windows 10 Convert many hyperlinks to the actual url, document-wide, not individually Office 2016
Novice
Convert many hyperlinks to the actual url, document-wide, not individually
 
Join Date: Sep 2017
Posts: 5
enso is on a distinguished road
Default Convert many hyperlinks to the actual url, document-wide, not individually

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?
Reply With Quote
  #2  
Old 02-24-2020, 07:48 PM
Charles Kenyon Charles Kenyon is offline Convert many hyperlinks to the actual url, document-wide, not individually Windows 10 Convert many hyperlinks to the actual url, document-wide, not individually Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 6,391
Charles Kenyon is a name known to allCharles Kenyon is a name known to allCharles Kenyon is a name known to allCharles Kenyon is a name known to allCharles Kenyon is a name known to allCharles Kenyon is a name known to all
Default

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.
Reply With Quote
  #3  
Old 02-24-2020, 09:07 PM
macropod's Avatar
macropod macropod is offline Convert many hyperlinks to the actual url, document-wide, not individually Windows 7 64bit Convert many hyperlinks to the actual url, document-wide, not individually Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 20,049
macropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud of
Default

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
For 2:
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 PC macro installation & usage instructions, see: Installing Macros
For Mac macro installation & usage instructions, see: Word:mac - Install a Macro
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #4  
Old 02-24-2020, 09:15 PM
macropod's Avatar
macropod macropod is offline Convert many hyperlinks to the actual url, document-wide, not individually Windows 7 64bit Convert many hyperlinks to the actual url, document-wide, not individually Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 20,049
macropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud of
Default

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
[MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert many hyperlinks to the actual url, document-wide, not individually Convert html links into embedded hyperlinks 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


All times are GMT -7. The time now is 11:25 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft