Solved

Include Hyperlink in email sent from vbscript

Posted on 2007-03-19
17
1,915 Views
Last Modified: 2012-08-14
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.
0
Comment
Question by:jcwiatr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 6
  • 3
17 Comments
 
LVL 67

Expert Comment

by:sirbounty
ID: 18753546
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
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18753557
If not, what is Item.EntryID equal to?  Does it include the preceding \\
0
 
LVL 1

Author Comment

by:jcwiatr
ID: 18753577
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.
0
SendBlaster Pro 4 - Bulk Email Sending Software

SendBlaster 4 Pro - Best Bulk Emailing Sending Software
Automatic Subscribe / Unsubscribe Processing
Great for Newsletters & Mass Mailings
Optional HTML & Text Composition
Integration with Google Features
Built in Spam Score Checking
Free Professional Templates - Feature Packed!

 
LVL 67

Expert Comment

by:sirbounty
ID: 18753616
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?
0
 
LVL 1

Author Comment

by:jcwiatr
ID: 18753631
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.
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18753650
Hmm - I wonder if this is possible?  Doesn't that point to a specific Outlook session id?
0
 
LVL 1

Author Comment

by:jcwiatr
ID: 18753669
not sure about that.  I hope it is possible :)
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18753675
You're trying to point another user to a task on your system using this link, correct?
0
 
LVL 1

Author Comment

by:jcwiatr
ID: 18753677
the task is in a public folder.  Juls
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18753702
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...
0
 
LVL 1

Author Comment

by:jcwiatr
ID: 18753945
Thanks anyway. appreciate your time.
0
 
LVL 76

Accepted Solution

by:
David Lee earned 250 total points
ID: 18754892
If the problem is that the item isn't appearing as a hyperlink, then I think the problem has to do with link formatting as opposed to whether the link itself is a valid link.  Even if the link were invalid it should still appear as a proper link.  You don't mention what body format you're using in your message, although from this line

    NewItem.Body = "<Outlook:" & Item.EntryID & ">" & vbCrLf

it appears that you're using Plain-Text.  If so, then try the link without the brackets, i.e. outlook:entryid.  If you really wanted to use HTML format for the message, then you need to use NewItem.HTMLBody instead of NewItem.Body.  For HTML I'd also recommend using a proper link, i.e. <a href="outlook:entryid">Link Text</a>
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18755412
Just the 'someone' I was thinkin of...howdy neighbor. :^)
0
 
LVL 1

Author Comment

by:jcwiatr
ID: 18760044
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.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 18760942
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.
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18760967
:^) 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
0
 
LVL 76

Expert Comment

by:David Lee
ID: 18761070
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.  
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question