#1
|
|||
|
|||
Difference between Address and Name in a Hyperlink Field?
Hello. I should know the answer to this, but either I never did, or else I have forgotten!
My VBA code is to loop through a document converting Hyperlink fields to IncludeText fields. This will unite all my chapters of text into a single book for export. The screenshot image shows THREE target addresses, all pointing, correctly, to the file "MrPuzeysNephewcolin.doc". I reason that if there are three places in a hyperlink field, then there must be a reason for each place. That is, each of "Address", "AddressOld" and "Name" must serve a different purpose. Of course I want to know which of those three will be correct for my purpose; I don't want the VBA code to err a few months down the road because a document arises that triggers a different purpose for my chosen sub-field. Thanks, Chris |
#2
|
||||
|
||||
It isn't immediately apparent how those three differ and you would probably need to ask an old MS engineer why there was once a need for .Address and .AddressOld. It appears that they all stay aligned but only one is editable via vba - both .AddressOld and .Name are read-only properties which change their values by changing .Address.
Code:
Sub aa() Dim aHL As Hyperlink Set aHL = ActiveDocument.Hyperlinks(1) aHL.Address = "Hi mum" Debug.Print aHL.AddressOld 'a read only property Debug.Print aHL.Name 'a read only property End Sub HTML Code:
<a name="hello">
By extension, I would hypothesize that .AddressOld comes into play when saving the Word file in a particular file format like RTF.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
Thank you Andrew.
.Address it is for me then. I must apologize. I am using Word2003, and since that is so out-of-date (as am I) that might have made a difference. I appreciate your advice, and rather suspect that some inexplicable parts of Word2003 are due to parts of the product being rushed out of the door. Cheers, and thanks again. Chris |
Tags |
field code hyperlink |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
can you batch edit hyperlink address syntax? | Dane Cole | Word | 3 | 02-19-2019 02:49 PM |
How to extract selected hyperlink address to clipboard? | poetofpiano | Word VBA | 8 | 02-18-2018 07:17 PM |
Hyperlink formula returning 'invalid site address' | MarkH | Excel | 0 | 12-26-2015 10:43 AM |
Cant unformat email address hyperlink in Excel the way HELP says I can | tomseeley | Excel | 11 | 01-24-2014 05:50 PM |
Hyperlink address fields from Excel | BongoBill | Word | 0 | 04-13-2010 04:27 AM |