Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-28-2023, 04:43 PM
Marrick13 Marrick13 is offline Change color of hyperlinks in multiple documents Windows XP Change color of hyperlinks in multiple documents Office 2010 32bit
Competent Performer
Change color of hyperlinks in multiple documents
 
Join Date: Jun 2006
Posts: 102
Marrick13 will become famous soon enough
Default Change color of hyperlinks in multiple documents

I am trying to get a macro to change the font color of all hyperlinks in multiple Word documents in a folder. I also want to be able to use RGB colors rather than colorindex colors. I have been using base code posted by Macropod in this forum but the best it does it that it works sometimes. (And in Macropod’s model code was this code to open the files in the selected folder:

Set wdDoc = Documents.Open(FileName:=strFolder & "" & strFile, AddToRecentFiles:=False, Visible:=False)
With wdDoc

I found that the target docs not only did not ever get updated this way, but the macro also opened other documents as well that are on my PC (but not in the chosen folder). When I added this before ‘With wdDoc’:

Set wdDoc = ActiveDocument

Then the macro opened only the files in the target folder and updated them, but it did not update the files all the time. It seems when it works with one color, I have to close Word after the macro runs, change the color in the code, then run it again. And even then, it only sometimes changes the hyperlink color in the documents. When it works and formats the links, it runs through the 5 test documents in the folder within about 30 seconds. When the macro runs but is not updating the files, it runs much more slowly.

Inconsistency and having to close Word are unacceptable to me. Either it works or it doesn’t.

Any ideas on how to make this code apply any RGB color to all links in documents in the selected folder on demand?



The macro is in the attachment.
Attached Files
File Type: docm Update Document Link Color.docm (23.1 KB, 3 views)
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Change color of hyperlinks in multiple documents VBA to change multiple change drop down font color and make bold bwhitlock Word VBA 1 08-08-2022 12:18 AM
Change color of hyperlinks in multiple documents How to change multiple hyperlinks in word 2019 Zakko Word 5 04-08-2019 08:04 PM
Change color of hyperlinks in multiple documents Removing Hyperlinks in Multiple Documents at Once Jude24Joy Word VBA 10 06-13-2017 05:38 AM
Change the color of multiple borders Jim Robison Excel 2 09-06-2016 11:08 AM
Change color of hyperlinks in multiple documents Change Multiple Documents from US to UK language swifty2010 Word 1 03-08-2011 02:00 PM

Other Forums: Access Forums

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


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