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: 7
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: 9,081
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
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: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
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
[Fmr 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: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
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
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 02-25-2021, 05:19 PM
LQuinn LQuinn 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
Novice
 
Join Date: Jan 2021
Location: Western Australia
Posts: 20
LQuinn is on a distinguished road
Default

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
Attached Images
File Type: png pre_post1_post2.png (25.1 KB, 14 views)
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

Other Forums: Access Forums

All times are GMT -7. The time now is 03:14 AM.


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