Hi,
I am using MS Access as an IT Inventory database. I will be giving users access to a form where they can make changes to the existing records. However, I want to be able to keep an eye on this, so when changes are made an email gets sent to me. I am using the VBA code below:
Public Function VBAEmail()
Dim myOutlook As Object
Dim myMailItem As Object
' Make instance
Set myOutlook = CreateObject("Outlook.Application")
' Make mail item
Set myMailItem = myOutlook.createitem(0)
' Set recipient (internal mail)
'myMailItem.Recipients.Add "Doe, John"
' Set recipient (external mail)
myMailItem.Recipients.Add "john.doe@needthistowork.com"
' Set subject
myMailItem.Subject = "A Change has been made to your Asset Inventory Item"
' Set body
myMailItem.body = "A Change has been made to your Asset Inventory Item"
' And send it!
myMailItem.send
' Close instance
Set myOutlook = Nothing
End Function
When I run this code, the following MS Outlook warning box appears:
A Program is trying to access email addresses that you have stored in Outlook.... If this is unexpected, it may be a virus and you should choose 'No'.
I do not want this interruption. I don't even want the users to know that an email is being sent to me. Is there a way around this ?
Thanks !
I am using MS Access as an IT Inventory database. I will be giving users access to a form where they can make changes to the existing records. However, I want to be able to keep an eye on this, so when changes are made an email gets sent to me. I am using the VBA code below:
Public Function VBAEmail()
Dim myOutlook As Object
Dim myMailItem As Object
' Make instance
Set myOutlook = CreateObject("Outlook.Application")
' Make mail item
Set myMailItem = myOutlook.createitem(0)
' Set recipient (internal mail)
'myMailItem.Recipients.Add "Doe, John"
' Set recipient (external mail)
myMailItem.Recipients.Add "john.doe@needthistowork.com"
' Set subject
myMailItem.Subject = "A Change has been made to your Asset Inventory Item"
' Set body
myMailItem.body = "A Change has been made to your Asset Inventory Item"
' And send it!
myMailItem.send
' Close instance
Set myOutlook = Nothing
End Function
When I run this code, the following MS Outlook warning box appears:
A Program is trying to access email addresses that you have stored in Outlook.... If this is unexpected, it may be a virus and you should choose 'No'.
I do not want this interruption. I don't even want the users to know that an email is being sent to me. Is there a way around this ?
Thanks !