-
WSChris Scott
AskWoody LoungerHi,
Yes the the hyperlink still shows the path to the old location and the link is still valid.
This MsgBox still gives an error. Same as before with the OldPath not being set.
Also, in the OldPath variable set, this portion – .LinkFormat.SourceFullName – is giving the message .
Thanks
-
WSChris Scott
AskWoody LoungerHi Chris,
Actually, that message box shouldn’t be there – it’s left over from testing. I’ll have to remove it.
Nonetheless, that doesn’t solve your problem. Are you adding the code to a new (unsaved) document, or to an existing document?
Hi,
Ok. And I am adding it to an existing document.
Thanks
Edit: So I removed the msg box line and also created a new document to test it in. I am still getting the error with it not being able to find the OldPath. It is now occurring in this line:
If OldPath NewPath Then .LinkFormat.SourceFullName = _
Replace(.LinkFormat.SourceFullName, OldPath, NewPath)There seems to be an error setting the OldPath variable. Could this possibly have something to do with Hyperlinks? What would you suggest I do?
Thanks
-
WSChris Scott
AskWoody LoungerHi Chris,
I see you’re working with docx files, which suggests Word 2007 or later. Word 2007 introduced some changes to the way fields with external links are handled, and this may be one of its victims. The macro solution should still work, though.
It seems as though I am having the same issue as some else. It is giving me error 91 when running the macro.
I included that extra code line and it still won’t work. I have deduced that the issue is that it cannot find the old path. Here is the line that it now fails at:
MsgBox OldPath & vbCr & NewPath & vbCr & Replace(.LinkFormat.SourceFullName, OldPath, NewPath)
When hovering my mouse over the OldPath item there are just empty quotes (” “).
Thanks!
-
WSChris Scott
AskWoody LoungerHi Macropod,
I have been trying your method of creating relative links and it is still giving me some trouble. It seems as though once I save and close the document that the FILENAME field changes from an updatable field, to just the path.
The ‘main’ document that I am using is located here: D:Installation Files– Next Co-op Student –Co-op Resources Guide-good – Copy.docx. This is the document that I created the FILENAME field in, so that may be why it is showing up in the re-opened doc.
Here is the field code before closing: { HYPERLINK “{ FILENAME p }\..\01 PEAKS Testing 5.2” }
And then after re-opening: { HYPERLINK “file:///D:\Installation%20Files\–%20Next%20Co-op%20Student%20–\Co-op%20Resources%20Guide-good%20-%20Copy.docx\..\01%20PEAKS%20Testing%205.2” }
I was wondering if you could help me figure out why this is happening.
Thanks!
Edit: Also I should note that when the file is re-opened the hyperlink still works.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Disengage Bitlocker
by
CWBillow
57 minutes ago -
Mac Mini M2 Service Program for No Power Issue
by
Alex5723
1 hour, 33 minutes ago -
New Win 11 Pro Geekom Setup questions
by
Deo
3 hours, 17 minutes ago -
Windows 11 Insider Preview build 26200.5651 released to DEV
by
joep517
8 hours, 48 minutes ago -
Windows 11 Insider Preview build 26120.4441 (24H2) released to BETA
by
joep517
8 hours, 50 minutes ago -
iOS 26,, MacOS 26 : Create your own AI chatbot
by
Alex5723
12 hours, 45 minutes ago -
New PC transfer program recommendations?
by
DaveBoston
3 hours, 5 minutes ago -
Windows 11 Insider Preview Build 22631.5545 (23H2) released to Release Preview
by
joep517
16 hours, 49 minutes ago -
Windows 10 Build 19045.6029 (22H2) to Release Preview Channel
by
joep517
16 hours, 50 minutes ago -
Best tools for upgrading a Windows 10 to an 11
by
Susan Bradley
5 hours, 10 minutes ago -
The end of Windows 10 is approaching, consider Linux and LibreOffice
by
Alex5723
2 hours, 32 minutes ago -
Extended Windows Built-in Disk Cleanup Utility
by
bbearren
15 hours ago -
Win 11 24H2 June 2025 Update breaks WIFI
by
dportenlanger
1 day, 11 hours ago -
Update from WinPro 10 v. 1511 on T460p?
by
CatoRenasci
9 hours, 43 minutes ago -
System Restore and Updates Paused
by
veteran
1 day, 14 hours ago -
Windows 10/11 clock app
by
Kathy Stevens
1 day, 1 hour ago -
Turn off right-click draw
by
Charles Billow
1 day, 17 hours ago -
Introducing ChromeOS M137 to The Stable Channel
by
Alex5723
1 day, 21 hours ago -
Brian Wilson (The Beach Boys) R.I.P
by
Alex5723
14 hours, 58 minutes ago -
Master patch listing for June 10, 2025
by
Susan Bradley
1 day, 22 hours ago -
Suggestions for New All in One Printer and a Photo Printer Windows 10
by
Win7and10
1 day, 1 hour ago -
Purchasing New Printer. Uninstall old Printer Software First?
by
Win7and10
2 days, 4 hours ago -
KB5060842 Issue (Minor)
by
AC641
16 hours, 49 minutes ago -
EchoLeak : Zero Click M365 Copilot leak sensitive information
by
Alex5723
2 days, 11 hours ago -
24H2 may not be offered June updates
by
Susan Bradley
1 day, 4 hours ago -
Acronis : Tracking Chaos RAT’s evolution (Windows, Linux)
by
Alex5723
3 days ago -
June 2025 updates are out
by
Susan Bradley
5 hours, 49 minutes ago -
Mozilla shutting Deep Fake Detector
by
Alex5723
3 days, 15 hours ago -
Windows-Maintenance-Tool (.bat)
by
Alex5723
3 days ago -
Windows 11 Insider Preview build 26200.5641 released to DEV
by
joep517
3 days, 17 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.