O
OssieMac
Access 2002 and 2003.
I currently have the code below to send emails. (Developed in Access 2003)
and it works fine.
I have set the Reference in Tools to Microsoft Outlook 11.0 Object Library.
If I load the project into Access 2002 then I get an error due to Missing
Reference and have to manually delete it and reset it to Microsoft Outlook
10.0 Object Library.
Is there any method of automating this so that I can allow a general user to
copy in updated Front Ends?
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
Dim strToAddress As String
Dim strBCC
Dim strSubject As String
Dim strBody As String
Dim strInvoicePathAndFile As String
Set objOutlook = CreateObject("Outlook.Application")
Set objEmail = objOutlook.CreateItem(olMailItem)
With objEmail
.To = strToAddress
If strBCC <> "" Then
.BCC = strBCC
End If
.Subject = strSubject
.Body = strBody
If Me.txtInvOrTxt = "Invoice" Then
.Attachments.Add (strInvoicePathAndFile)
End If
If Me.chkEmailEdit Then 'User can edit email
.Display
'Ensure message is top Active Window
AppActivate (strSubject & " - Message")
Else
.Send
End If
End With
Set objEmail = Nothing
Set objOutlook = Nothing
I currently have the code below to send emails. (Developed in Access 2003)
and it works fine.
I have set the Reference in Tools to Microsoft Outlook 11.0 Object Library.
If I load the project into Access 2002 then I get an error due to Missing
Reference and have to manually delete it and reset it to Microsoft Outlook
10.0 Object Library.
Is there any method of automating this so that I can allow a general user to
copy in updated Front Ends?
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
Dim strToAddress As String
Dim strBCC
Dim strSubject As String
Dim strBody As String
Dim strInvoicePathAndFile As String
Set objOutlook = CreateObject("Outlook.Application")
Set objEmail = objOutlook.CreateItem(olMailItem)
With objEmail
.To = strToAddress
If strBCC <> "" Then
.BCC = strBCC
End If
.Subject = strSubject
.Body = strBody
If Me.txtInvOrTxt = "Invoice" Then
.Attachments.Add (strInvoicePathAndFile)
End If
If Me.chkEmailEdit Then 'User can edit email
.Display
'Ensure message is top Active Window
AppActivate (strSubject & " - Message")
Else
.Send
End If
End With
Set objEmail = Nothing
Set objOutlook = Nothing