Hi,
I apologize now if I am asking a silly question, but to say I'm new to access would be an understatement. I have a database that auto generates emails. The database sits on a server and is accessed by users using Microsoft outlook 10. We recently had a machine upgraded and the IT department have installed outlook 2003, which needs Microsoft Outlook Library 11.0.
At the moment I cant seem to find a way to reference both Microsoft Object Libraries. If I select 10 the new PC can't log in and if I select 11 all other users are logged out. I have been desperately trying to find a way of referencing both libraries but to no avail. Is there anyone that could suggest a method I can use to use both versions of outlook in the database. I have provided the code for the send mail function below:
Public Function SendMail(strFrom, strTo As String, strCC As String, strBCC As String, strSubject As String, strBody As String) As Boolean
On Error GoTo errSendMail
Dim objOL As New Outlook.Application
Dim objMail As MailItem
Set objOL = New Outlook.Application
Set objMail = objOL.CreateItem(olMailItem)
With objMail
.BodyFormat = olFormatHTML
.HTMLBody = strBody
.To = strTo
.CC = strCC
.BCC = strBCC
.Subject = strSubject
.SentOnBehalfOfName = strFrom
.Display
End With
Set objMail = Nothing
Set objOL = Nothing
'return true on success
SendMail = True
Exit Function
errSendMail:
SendMail = False
MsgBox (Err.Description)
End Function
I apologize now if I am asking a silly question, but to say I'm new to access would be an understatement. I have a database that auto generates emails. The database sits on a server and is accessed by users using Microsoft outlook 10. We recently had a machine upgraded and the IT department have installed outlook 2003, which needs Microsoft Outlook Library 11.0.
At the moment I cant seem to find a way to reference both Microsoft Object Libraries. If I select 10 the new PC can't log in and if I select 11 all other users are logged out. I have been desperately trying to find a way of referencing both libraries but to no avail. Is there anyone that could suggest a method I can use to use both versions of outlook in the database. I have provided the code for the send mail function below:
Public Function SendMail(strFrom, strTo As String, strCC As String, strBCC As String, strSubject As String, strBody As String) As Boolean
On Error GoTo errSendMail
Dim objOL As New Outlook.Application
Dim objMail As MailItem
Set objOL = New Outlook.Application
Set objMail = objOL.CreateItem(olMailItem)
With objMail
.BodyFormat = olFormatHTML
.HTMLBody = strBody
.To = strTo
.CC = strCC
.BCC = strBCC
.Subject = strSubject
.SentOnBehalfOfName = strFrom
.Display
End With
Set objMail = Nothing
Set objOL = Nothing
'return true on success
SendMail = True
Exit Function
errSendMail:
SendMail = False
MsgBox (Err.Description)
End Function