Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-09-2016, 10:05 AM
dan88 dan88 is offline Convert Hyperlinks to ahref Windows 10 Convert Hyperlinks to ahref Office 2016
Novice
Convert Hyperlinks to ahref
 
Join Date: Feb 2016
Posts: 24
dan88 is on a distinguished road
Default Convert Hyperlinks to ahref

Hi all,



I have a hyperlink issue.

My Word doc has all these clickable hyperlinks, I am trying to convert the clickable link into a html link

Example:

Delicious Coffee

Converted to

<a href="http://www.coffee.com/delicious ">Delicious Coffee </a>


Bear Taxonomy

<a href =“http://www.bear.com/bearclassification”> Bear Taxonomy </a>

etc


I only managed to insert the last </a> . The rest I couldn't work out how to do


http://windowssecrets.com/forums/sho...RLs-from-links



Code:
Sub HyperlinkToParagraph1()
Application.ScreenUpdating = False
Dim i As Long, Rng As Range
With ActiveDocument
  For i = .Hyperlinks.Count To 1 Step -1
    With .Hyperlinks(i)
      Set Rng = .Range
      
      'Rng.InsertAfter ": "
      
      'Rng.InsertAfter " <a href = "   ">


      Rng.MoveEndUntil cset 
  
      
      Rng.Collapse wdCollapseEnd
      Rng.FormattedText = .Range.FormattedText
      Rng.Hyperlinks(1).TextToDisplay = .Address
      Rng.InsertAfter "</a>"
      
      .Range.Fields(1).Unlink
    End With
  Next
End With
Application.ScreenUpdating = True

End Sub

Any help appreciated

dan
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Hyperlinks to ahref Convert html links into embedded hyperlinks njcloud Mail Merge 23 02-04-2020 02:00 PM
Word 2013's "File > Convert" only partly converts some Hyperlinks RichardDavey Word 0 05-27-2015 10:37 AM
Hyperlinks in PP ArtemMetr PowerPoint 2 03-20-2015 01:57 AM
Convert Hyperlinks to ahref PDF hyperlinks banccard Word 1 12-22-2011 08:45 PM
hyperlinks forrestgump Word 0 12-30-2010 04:14 AM

Other Forums: Access Forums

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


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