troubleshooting Question

How do I make a hyperlink that includes spaces in email VBA code?

Avatar of CFMI
CFMIFlag for United States of America asked on
Microsoft AccessMicrosoft Office
7 Comments4 Solutions1742 ViewsLast Modified:
I really have two questions (but #2 is predicated on #1 working):
1)  The code below shows the body of an email with a hyperlink to a path which has spaces in it.  The code works fine to a directory path without spaces.  When it reaches a space however, the code doesn't notice any part of the path beyond the space.
2)  Since I haven't gotten beyond #1 above, I just want to make sure I can use variants within the path to further identify the directory.
>>>>> How do I get beyond #1 question so a space is acceptable to VBA in this hyperlink?

Dim InvPer As String
Dim NewRef3 As String
NewRef3 = Format(Date(), "yyyy")
InvPer = Format(Date(), "mm.yy")
.HTMLBody = "Mary,   " & "<BR>" & "<BR>" & _
            "The " & Chr(34) & "<I>" & "Trial Balance.xlsx" & "</I>" & Chr(34) & " file in the " & _
        '"<a href=\\\corp\shared\Finance\Finance Shared\Beeline\Invoices>" & _
            "S:\Finance\Finance Shared\Beeline\Invoices\" & NewRef3 & "\" & InvPer & "\" & "</a>" & _
            " directory has been updated.  " & "<BR>" & "<BR>" & _
            "Please notify if I can be of further assistance. " & "<BR>" & "<BR>" & _
            "Thanks. "

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 4 Answers and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 4 Answers and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros