Hi,
I am getting the following error message and I believe it has something to do with the way I am sending an automatic email when a file is updated. However I am new to Access so unsure what I need to change in my code. I am using Access 2010 and Outlook 2010.
Code:
Dim objOLApp As Object
Dim outItem As Object
Dim DestFolder As Object
Dim outNameSpace As Object
'On Error GoTo Err_SetupOutlookEmail
Set objOLApp = CreateObject("Outlook.Application")
Set outNameSpace = objOLApp.GetNamespace("MAPI")
Set outFolder = outNameSpace.GetDefaultFolder(6)
Set outItem = objOLApp.CreateItem(0)
'DEFINE THE GROUPS
Agent_Name = Me.txtNewAgentName
Site = Me.cboNewSite
Dept = Me.cboNewDept
Team = Me.cboNewTeam
With outItem
'EMAIL ADDRESS
.To = ""
.CC = ""
.BCC = ""
.Subject = "New file added - " & Me.txtNewAgentName
'Set Body Format to HTML
.BodyFormat = 2
'Format the Message
.HTMLBody = _
"<html>" & _
"<font size = '2' face = 'Calibri'>" & _
"<b>" & "Agent Name: " & "</b>" & Me.txtNewAgentName & "<br>" & "<br>" & _
"<b>" & "Site: " & "</b>" & Me.cboNewSite & "<br>" & "<br>" & _
"<b>" & "Dept: " & "</b>" & Me.cboNewDept & "<br>" & "<br>" & _
"<b>" & "Team: " & "</b>" & Me.cboNewTeam & "<br>" & "<br>" & _
"</html>"
.Send
End With
Thanks