#1
|
|||
|
|||
Can anyone help me with renaming of specific hyperlinks macro
So a user has macros to shorten hyperlinks in footnotes to "URL" for example, I need to reverse this and have a macro to change all hyperlinks named URL back to their full web url.
Can anyone assist? I tried to find and replace but im not sure what to put as the new name in the entry field which would enable the renamed hypers to go back to their full url address. Much appreciated. |
#2
|
||||
|
||||
Can you post an example document so that we can see what you are working with?
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
Quote:
Original URL Armed conflict location and event data project July 15th 2018-June 2020 https://exampleurl.com Shortened. Armed conflict location and event data project July 15th 2018-June 2020 url I want to try and create a macro to switch the renamed hyperlinks labelled "url" back to the full web link like shown above. thanks for your time. |
#4
|
||||
|
||||
Sorry but that doesn't help. We need to see an actual example in a document so that we can establish what the link actually contains.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#5
|
||||
|
||||
Based on this and your other post at Help to create a Word macro to change re-named Hyperlinks back to their full web addr the following should work. If not, do as Iasked and send a sample document.
Code:
Sub Macro1() Dim oLink As Hyperlink For Each oLink In ActiveDocument.Hyperlinks If UCase(oLink.TextToDisplay) Like "*URL*" Then oLink.TextToDisplay = oLink.Address End If Next oLink End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#6
|
|||
|
|||
Quote:
|
#7
|
|||
|
|||
Quote:
|
#8
|
||||
|
||||
Try this code which toggles from one to the other
Code:
Sub ToggleURLs() Dim aHL As Hyperlink For Each aHL In ActiveDocument.Hyperlinks If aHL.TextToDisplay = "url" Then aHL.TextToDisplay = aHL.Address Else aHL.TextToDisplay = "url" End If Next aHL End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#9
|
|||
|
|||
Legend thanks a lot
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro: How to get this macro to save to a specific location | LOUF | Word VBA | 1 | 12-07-2015 06:47 PM |
Can anyone here tweek this macro for renaming Excel files based on a cell's contents? | chrisd2000 | Excel Programming | 6 | 07-01-2014 01:53 PM |
Macro Needed to bold specific lines and Macro to turn into CSV | anewteacher | Word VBA | 1 | 05-28-2014 03:59 PM |
Image Renaming Macro? | jammer | PowerPoint | 5 | 07-15-2013 09:21 AM |
Create Hyperlinks from Word to specific location in PDF | sukanyae | Word | 0 | 02-25-2010 04:08 PM |