|
-
Dec 18th, 2003, 03:48 PM
#1
Thread Starter
New Member
Creating a Hyperlink Alias in VB?
I am trying to create an Outlook email message with hyperlinks from Access using a VB module. Everything works fine, but now I want to change the way the hyperlinks are displayed. Instead of giving the entire hyperlink address I want to give an alias. Example: Instead of reading "Click here to go to Hotmail - http://www.hotmail.com" It should read "Click here to go to Hotmail". Hotmail should be the hyperlink with the address hidden.
How do I create the alias?
Here is what I have so far:
Function SnapMailMessage()
Dim ol As New Outlook.Application
Dim ns As Outlook.NameSpace
Dim newMail As Outlook.MailItem
'Return a reference to the MAPI layer.
Set ns = ol.GetNamespace("MAPI")
'Create a new mail message item.
Set newMail = ol.CreateItem(olMailItem)
With newMail
'Add the subject of the mail message.
.Subject = "The Subject"
'Attach a file
With .Attachments.Add _
("C:\WINNT\WINNT\file.xls")
.DisplayName = "Your File Details"
End With
'Create some body text.
'.Body = "Click here to go to Hotmail - http://www.hotmail.com/" & vbCrLf
'Diplay the email
.Display
End With
'Release memory.
Set ol = Nothing
Set ns = Nothing
Set newMail = Nothing
End Function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|