Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-02-2015, 12:07 AM
gmayor's Avatar
gmayor gmayor is offline Trying to create a macro to batch edit hyperlinks Windows 7 64bit Trying to create a macro to batch edit hyperlinks Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The basic process works as intended here. I agree that if the code is an accurate representation, the problem is

Call ReplaceHyperlinkURL("W:\", "E:\My Documents\")


Sub ReplaceHyperlinkURL()

End Sub

You are using a sub with the same name as the main sub to call it and yet the call is outside the second sub.

Code:
Sub RunReplaceURL()   
     Call ReplaceHyperlinkURL("W:\", "E:\My Documents\") 
End Sub
as suggested will fix it.

Note that the process is case sensitive, and while it is unlikely that your hyperlinks contain 'w:\' in lower case, it is not impossible and it won't work for those links. In which case either correct for case in the main sub or call it a second time with lower case 'w:\'.

Use the # button and paste your code between the markers in inserts to keep the format or your code.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch edit mail merge macros? kbash Word 0 04-30-2014 08:32 AM
Trying to create a macro to batch edit hyperlinks Batch create Word documents cdfj Word VBA 6 11-07-2012 01:03 PM
Trying to create a macro to batch edit hyperlinks Batch Edit Links tosti PowerPoint 5 01-31-2012 12:51 PM
Using hyperlinks to create interactive menus hongkongphooey PowerPoint 0 01-25-2011 07:30 AM
Create Hyperlinks from Word to specific location in PDF sukanyae Word 0 02-25-2010 04:08 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:50 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