A
Adam USAF
I've found several similar problems, but no real solutions. I have Access
2007 VBA code that sends an email using Outlook 2007. This works on my
personal computer, though not on my work (DoD) computers (run-time error
'287' at .send or at .recipients.add if I don't pull a list from a table).
The code did work when Office 2003 was utilized at work, though not after
upgrading to Office 2007. Since the code works on my personal computer (which
has Office 2007), I know that it is not a coding issue. I have explored the
Trust Center in both Outlook and Access on both my personal and work
computers to compare for differences. Every change that I was able to make at
home to match work settings still allowed the code to send the email. I'm
stumped. The ideas that I have are differing Add-ins, Service Packs not
installed on the work computers, Microsoft Outlook 12 reference not
connecting (it is listed), or the fact that I'm using a POP3 email account
from home, and a Microsoft Exchange Server account at work. I've posted the
general code below. Any pointers would be greatly appreciated. Thanks in
advance.
Private Sub Command50_Click()
Set objOutlook = Outlook.Application
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
..Subject = "Test"
..Importance = olImportanceHigh
..Recipients.Add ("(e-mail address removed)")
'.To = "(e-mail address removed)"
..Send
End With
End Sub
2007 VBA code that sends an email using Outlook 2007. This works on my
personal computer, though not on my work (DoD) computers (run-time error
'287' at .send or at .recipients.add if I don't pull a list from a table).
The code did work when Office 2003 was utilized at work, though not after
upgrading to Office 2007. Since the code works on my personal computer (which
has Office 2007), I know that it is not a coding issue. I have explored the
Trust Center in both Outlook and Access on both my personal and work
computers to compare for differences. Every change that I was able to make at
home to match work settings still allowed the code to send the email. I'm
stumped. The ideas that I have are differing Add-ins, Service Packs not
installed on the work computers, Microsoft Outlook 12 reference not
connecting (it is listed), or the fact that I'm using a POP3 email account
from home, and a Microsoft Exchange Server account at work. I've posted the
general code below. Any pointers would be greatly appreciated. Thanks in
advance.
Private Sub Command50_Click()
Set objOutlook = Outlook.Application
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
..Subject = "Test"
..Importance = olImportanceHigh
..Recipients.Add ("(e-mail address removed)")
'.To = "(e-mail address removed)"
..Send
End With
End Sub