Link to home
Start Free TrialLog in
Avatar of jcwiatr
jcwiatrFlag for Australia

asked on

Include Hyperlink in email sent from vbscript

When a task is created in a folder, I am trying to send an email and include a hyperlink to the EntryID of a task just created.  When an internal user receives the email, I want them to click the hyperlink which will take them to the task in a public folder.  I have the following code in the item_close() event within an custom outlook forms vbscript:

Set NewItem = Application.CreateItem(0)
NewItem.To = "support@xyzi.com"
NewItem.Recipients.ResolveAll
NewItem.Subject = "Item# " & Item.UserProperties("Item")
NewItem.Body = "<Outlook:" & Item.EntryID & ">" & vbCrLf
NewItem.Send

However, when the email is received the hyperlink is not underlined... it just appears as normal text within the email body.

Points based on urgency.. Thank-you.
Avatar of sirbounty
sirbounty
Flag of United States of America image

Hmm - offhand, I'd say enclose it in quotes (and ensure the recipient is using html for their email editor).

NewItem.Body = "<Outlook:" & chr(34) & Item.EntryID & chr(34) & ">" & vbCrLf
If not, what is Item.EntryID equal to?  Does it include the preceding \\
Avatar of jcwiatr

ASKER

Hello.  The EntryID does not contain the \\ so I added this in also so the final result is - but it is still not hyperlinked.
<Outlook:\\000000001A447390AA6611CD9BC800AA002FC45A09007610CC3098D5C448B56689C934BC94C700000016CE1300007610CC3098D5C448B56689C934BC94C7000000171DBB0000>

I guess the question also is, how is the done manually if I was constructing and email manually.... maybe then I can apply the same syntax to the vbscript.
Oh - no, you won't need the \\ there...

I'm not very familiar with the method you're using, but I did find this (http://support.microsoft.com/kb/293152) which details using the GetItemFromID function - perhaps that will help?
Avatar of jcwiatr

ASKER

Hi sirBounty...  I have tried without the // as well.
I can access the ID OK... my issue is adding it to an email as a hyperlink within VBSCRIPT.
Hmm - I wonder if this is possible?  Doesn't that point to a specific Outlook session id?
Avatar of jcwiatr

ASKER

not sure about that.  I hope it is possible :)
You're trying to point another user to a task on your system using this link, correct?
Avatar of jcwiatr

ASKER

the task is in a public folder.  Juls
Sorry...I'm not the Outlook guru on this matter.
I've not gotten session IDs to load as hyperlinks before...not really sure you can, but I can't say for %100.  Hopefully someone with more knowledge in it will be by shortly...
Avatar of jcwiatr

ASKER

Thanks anyway. appreciate your time.
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just the 'someone' I was thinkin of...howdy neighbor. :^)
Avatar of jcwiatr

ASKER

Final solution: Used the following syntax.
NewItem.HTMLBody = "<a href=" & chr(34)  & "outlook:" & Item.EntryID & chr(34) & ">Text</a>" & vbCrLf

Thank-you both for you efforts.

Cheers.
Hi, SB!  How's everything going?  I'm struggling a bit with the new site and the loss of QP.

jcwiatr, I'm glad we could help out.
:^) Hi Blue...you're not the only one!
Now instead of QP and nicely answered questions, we get spammed! :'(
I detest this new method of participating...not sure how much longer I can take it! Haha
I'm definitely not a fan of the new site.  My participation is way down.  I'm hoping that someone puts something like QP together.  I know there are a couple of efforts to do that, so maybe we'll get some relief before too long.  The price of progress, I suppose.