View Single Post
 
Old 10-14-2019, 04:40 AM
rosskemmett rosskemmett is offline Windows 10 Office 2019
Novice
 
Join Date: Oct 2019
Posts: 1
rosskemmett is on a distinguished road
Default MS word Macro to change the hyperlink base relative to where the file is located

I have a word document which includes 100's of hyperlinks to working files which have been created over a period of time.

I now want to copy the word file along with the associated documents on to a hard drive to be used by someone outside our network.

For example these files are located in S:/Workfiles/jobnumber/myfiles....

I would copy the folder "myfiles" on to a hard drive and the word file which contains the hyperlinks would sit just inside this folder.

All of the documents which the hyperlinks need to talk to would be located in a folder tree also inside "myfiles" folder.

I can easily do a find and replace on the hyperlinks so that they now point to the directory of the hard drive I'm using "D:/myfiles. This would work as long as who ever im giving the hard drive to uses it on the "D" drive.

However, Say someone plugs the hard drive in and its now in an "E:/" drive, the hyperlinks will now not work unless that person does their own find and replace (changing from D to E drive.


Is it possible to create a macro which sets the "Hyperlink Base" address to reference the drive where the file currently sits. I assume it would involve the "filename" field.


or

does anyone have any other suggestions on how to solve this issue another way.

Thanks

Ross
Reply With Quote