Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-10-2022, 06:37 AM
ChrisGreaves ChrisGreaves is offline Difference between Address and Name in a Hyperlink Field? Windows 10 Difference between Address and Name in a Hyperlink Field? Office 97-2003
Novice
Difference between Address and Name in a Hyperlink Field?
 
Join Date: Nov 2022
Location: Bonavista, Newfoundland
Posts: 22
ChrisGreaves is on a distinguished road
Default 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
Attached Images
File Type: png Untitled.png (18.1 KB, 14 views)
Reply With Quote
  #2  
Old 12-10-2022, 04:58 PM
Guessed's Avatar
Guessed Guessed is offline Difference between Address and Name in a Hyperlink Field? Windows 10 Difference between Address and Name in a Hyperlink Field? Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,975
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
I am guessing but suspect the .Name property is relevant only saving the Word document to HTML. The Name attribute of an
HTML Code:
<a name="hello">
tag in HTML serves as an anchor (akin to a bookmark in Word) - see Anchor Tags and Name Attributes
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
Reply With Quote
  #3  
Old 12-11-2022, 11:47 AM
ChrisGreaves ChrisGreaves is offline Difference between Address and Name in a Hyperlink Field? Windows 10 Difference between Address and Name in a Hyperlink Field? Office 97-2003
Novice
Difference between Address and Name in a Hyperlink Field?
 
Join Date: Nov 2022
Location: Bonavista, Newfoundland
Posts: 22
ChrisGreaves is on a distinguished road
Default

Quote:
Originally Posted by Guessed View Post
... changing .Address.
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
Reply With Quote
Reply

Tags
field code hyperlink



Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between Address and Name in a Hyperlink Field? can you batch edit hyperlink address syntax? Dane Cole Word 3 02-19-2019 02:49 PM
Difference between Address and Name in a Hyperlink Field? 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

Other Forums: Access Forums

All times are GMT -7. The time now is 08:20 AM.


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