Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 07-19-2020, 06:01 PM
Guessed's Avatar
Guessed Guessed is offline Word macro to cut a range of text and apply to subsequent text as a hyperlink Windows 10 Word macro to cut a range of text and apply to subsequent text as a hyperlink Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,185
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Looking at the hyperlink of the one you did manually, it is relative to the current document location ie.
../Refs/Clinical_5.4/AichingerG_2011,_Ross_River_vaccine.pdf
Because it starts with .. this tells the system to go up one folder level and then down in to the Refs folder.

The other hyperlinks (which fail) have the full path defined. Also, the direction of the slashes seems to vary although I'm not sure that this is important.
Is your secondary software failing to convert the hyperlinks because the absolute path is invalid but the relative path is fine?

Are you able to run this macro on your Word document to see if that cures the problem when it hits the secondary software.
Code:
Sub ChangeHL()
  Dim aHL As Hyperlink, sLink As String
  For Each aHL In ActiveDocument.Hyperlinks
    sLink = aHL.Address
    sLink = Replace(sLink, "C:\Users\iaman\Desktop\eCTD_Office_Software\IND_Source_Folders\YFV_IND", "..")
    sLink = Replace(sLink, "\", "/")
    aHL.Address = sLink
  Next aHL
End Sub
If that 'repairs' the hyperlinks, you could customise the original macro to make the links relative on the first pass.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 

Tags
hyperlinking, macro find text



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro how to add hyperlink to text in document hullsquashboy Word VBA 32 06-28-2022 06:30 PM
Highlighting applied to range ending in a paragraph continues to apply to text added after Peterson Word VBA 2 10-08-2018 02:50 PM
Word macro to cut a range of text and apply to subsequent text as a hyperlink Word changing my body text to heading text when I apply paragraph numbering ddiemetric Word 1 01-17-2017 01:10 PM
Microsoft Word macro to find text, select all text between brackets, and delete helal1990 Word VBA 4 02-05-2015 03:52 PM
Word macro to cut a range of text and apply to subsequent text as a hyperlink Formatting- Apply changes to highlighted text results in same change to other text sential Word 6 01-10-2014 03:22 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:36 PM.


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