Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Starting Outlook via FollowHyperlink event

I have an e-mail address in a sheet, and a text in the column to the right
of the address. I use the FollowHyperlink event to trig the following code.

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

Dim olApp As New Outlook.Application
Dim olNewMail As Object
Dim Recep As String
Dim MsgTxt As String

Set olApp = GetObject("Outlook.Application")

Recep = Target.Value
MsgTxt = Target.Offset(0, 1).Value
Set olNewMail = CreateItem(olMailItem)
With olNewMail
.Recipients.Add Recep
.Body = MsgTxt
.Subject = "Automatisk mail"
.ReadReceiptRequested = False
.OriginatorDeliveryReportRequested = False
.Save
.Display
End With
End Sub

This opens an Outlook mailitem, with the recipeint from one column and the
text from the other ad it suposed to. The problem is, that the clicking the
hyperlink also performs its normal operation, that is opening a mailitem,
with only the recipient. Is there a way to cancel the orginal event and only
use my code? Of course I can use another event, but unfortunately the users
wants click on the mail address as they are used to.

Jan


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel to add event on outlook calender Dan Wood Excel Discussion (Misc queries) 1 March 2nd 10 09:53 AM
Stop Outlook from starting when typing email addresses into a cell asg2307 Excel Discussion (Misc queries) 2 January 16th 07 07:23 AM
Starting/Stopping Worksheet Event Code Paul987 Excel Discussion (Misc queries) 1 March 20th 06 04:43 PM
Outlook Event Entry RSS[_2_] Excel Programming 0 January 12th 06 06:21 PM
followhyperlink event for textboxs Ignatius Excel Programming 0 August 11th 03 11:25 PM


All times are GMT +1. The time now is 06:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"