icthus123
06-06-2007, 08:36 AM
I'm creating a database for the contact details of the various people involved with our company.
I'm trying to enable people to click on a contact and email that contact at the click of a button. I've set up some VBA to open a New Message in Outlook with the appropriate email address, etc.
However I'm at something of a loss as to what to do if the person using the database doesn't use Outlook. Some people in the office use Outlook express for example. Any ideas? My code is included below.
Private Sub cmdEmail_Click()
StartOutLook
End Sub
Public Function StartOutLook()
On Error GoTo Err_Handling
Dim objOutlook As Object
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
Set objOutlookRecip = .Recipients.Add(tbemail.Value)
objOutlookRecip.Type = olTo
.Subject = "Message from SP Projects"
.Body = "Dear " & cboTitle & " " & tbLastName
.Importance = olImportanceHigh
.Display
End With
Set objOutlook = Nothing
Exit Function
Err_Handling:
MsgBox "Error: " & Err & " " & Error
Exit Function
End Function
I'm trying to enable people to click on a contact and email that contact at the click of a button. I've set up some VBA to open a New Message in Outlook with the appropriate email address, etc.
However I'm at something of a loss as to what to do if the person using the database doesn't use Outlook. Some people in the office use Outlook express for example. Any ideas? My code is included below.
Private Sub cmdEmail_Click()
StartOutLook
End Sub
Public Function StartOutLook()
On Error GoTo Err_Handling
Dim objOutlook As Object
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
Set objOutlookRecip = .Recipients.Add(tbemail.Value)
objOutlookRecip.Type = olTo
.Subject = "Message from SP Projects"
.Body = "Dear " & cboTitle & " " & tbLastName
.Importance = olImportanceHigh
.Display
End With
Set objOutlook = Nothing
Exit Function
Err_Handling:
MsgBox "Error: " & Err & " " & Error
Exit Function
End Function