I am looking to get inputs from the user and flash-fill an email. The inputs being ID numbers I want to concatenate to the end of a static URL and link in the body of the email.
What I have so far:
Sub Release()
Dim objMsg As MailItem
Set objMsg = Application.CreateItem(olMailItem)
Dim Obj1 As String
Obj1 = InputBox("Enter ID1", "Input Number Only"
If Obj1 <> ""
With objMsg
strEmailBody = "Hello ___" & "Object #" & Obj1 & "<a href=""http://....id=""&Obj1>(link)</a>"
.HTMLBody = strEmailBody`
Everything seems to perform except the link, which is the static URL and does not concatenate the input number.
I tried changing around the quotation marks and changing the whole URL to a variable, but I cannot get more than just the string as typed to appear in the hyperlink.
It seems you just need to concatenate strings in VBA correctly:
strEmailBody = "Hello ___" & "Object #" & Obj1 & "<a href=" & Chr(34) &"http://....id=" & Obj1 & Chr(34) & ">(link)</a>"
Note, you can use the Chr function for inserting double quotes where necessary.