J
Jan T.
I use Office 2000 and try to set an email address on the Open Event
of a new mail. This is my code in ThisOutlookSession:
Dim WithEvents colInsp As Outlook.Inspectors
Dim WithEvents oMail As Outlook.MailItem
Private Sub Application_Startup()
Set colInsp = Application.Inspectors
End Sub
Private Sub colInsp_NewInspector(ByVal Inspector As Inspector)
If Inspector.CurrentItem.Class = olMail Then
Set oMail = Inspector.CurrentItem
End If
End Sub
Private Sub oMail_Open(Cancel As Boolean)
oMail.To = "(e-mail address removed)"
oMail.Subject = "Test"
oMail.Body = "This is a test..."
End Sub
PROBLEM: I can set the Subject and the Body to any text, but I cannot
add an email address to the To field? Why? Is it possible?
What do I need to do to set the email address in the To field?
Regards
Jan
of a new mail. This is my code in ThisOutlookSession:
Dim WithEvents colInsp As Outlook.Inspectors
Dim WithEvents oMail As Outlook.MailItem
Private Sub Application_Startup()
Set colInsp = Application.Inspectors
End Sub
Private Sub colInsp_NewInspector(ByVal Inspector As Inspector)
If Inspector.CurrentItem.Class = olMail Then
Set oMail = Inspector.CurrentItem
End If
End Sub
Private Sub oMail_Open(Cancel As Boolean)
oMail.To = "(e-mail address removed)"
oMail.Subject = "Test"
oMail.Body = "This is a test..."
End Sub
PROBLEM: I can set the Subject and the Body to any text, but I cannot
add an email address to the To field? Why? Is it possible?
What do I need to do to set the email address in the To field?
Regards
Jan