Avatar of LJG
LJG
 asked on

How do I set the address of a Hyperlink variable?

Question
How do I set the address of a Hyperlink variable?

Code
Dim strUrl As String
Dim hyper_Url As Hyperlink

'Start URL
strUrl = "https://www.google.com/maps/dir/

hyper_Url.Address = strUrl   '<------ this line errors out

What I'm trying to do
Build a URL for Google Maps direction.

The Whys
I can load the URL as a string in a browser, but when I try to send it in an email the email recognizes the first part of the URL and not the addresses I add.  So the user clicks on the URL in the email and doesn't get the map.  My thought is that if I had a Hyperlink variable to the email, it will work.

Thanks in advance for any help.
LJG
GoogleMicrosoft Access

Avatar of undefined
Last Comment
LJG

8/22/2022 - Mon
Norie

How are you creating the email?
SOLUTION
Gustav Brock

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
LJG

ASKER
Thanks for Responding

However I'm don't think that is the answer for me.

What I know from experimenting  -- Using Outlook

If I send ---> "Google Maps#https://www.google.com/maps/dir/#"
                .HTMLBody =strURL
                                   or
                .Body =strURL
I do not get a hyperlink in the email.

-----------------------
If I send ---> "https://www.google.com/maps/dir/
                .Body =strURL

I get a hyperlink in the email.
-------------------------

I can make the above work for me, but I thought maybe there was a way that Gustav talked about that I could get it to show in the email as "Google Maps" and when they clicked on "Google Maps" it would take them to my link.
ASKER CERTIFIED SOLUTION
Norie

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
LJG

ASKER
Thanks so much - this solves my problem
Your help has saved me hundreds of hours of internet surfing.
fblack61