MS Access - sending Email via Outlook
#1
Access Guru required.... Office 97 or greater - i add a reference to the Outlook Object and roughly do the following
-----------------------------------------------------
Set golApp = New Outlook.Application
Set objNewMail = golApp.CreateItem(olMailItem)
With objNewMail
.Subject = strSubject
.Body = strMessage
.Recipients.Add varRecip
blnResolveSuccess = .Recipients.ResolveAll
If Not IsMissing(varAttachment) Then
.Attachments.Add (varAttachment)
End If
If blnResolveSuccess Then
'.Send
.Display 'show the form rather than send straight away
-------------------------------------------------------------
Ok - i can get outlook to open - and attach a spreadsheet - but the user has to click "send"
The .Display bit is the question. I want to automatically send the email rather than the user having to do it. Anyone know what i do instead of .Display (cant find in help)
Also - i get a flash up screen saying "A program is trying to access email address you have stored in Outlook. Do you want to allow this?"
I can then choose to allow access (for set mins or complete control). But i dont want to have to do this.
Any ideas how i tell outlook to go for it in the code?
Jza
-----------------------------------------------------
Set golApp = New Outlook.Application
Set objNewMail = golApp.CreateItem(olMailItem)
With objNewMail
.Subject = strSubject
.Body = strMessage
.Recipients.Add varRecip
blnResolveSuccess = .Recipients.ResolveAll
If Not IsMissing(varAttachment) Then
.Attachments.Add (varAttachment)
End If
If blnResolveSuccess Then
'.Send
.Display 'show the form rather than send straight away
-------------------------------------------------------------
Ok - i can get outlook to open - and attach a spreadsheet - but the user has to click "send"
The .Display bit is the question. I want to automatically send the email rather than the user having to do it. Anyone know what i do instead of .Display (cant find in help)
Also - i get a flash up screen saying "A program is trying to access email address you have stored in Outlook. Do you want to allow this?"
I can then choose to allow access (for set mins or complete control). But i dont want to have to do this.
Any ideas how i tell outlook to go for it in the code?
Jza
#2
Use
.save
.send
instead of .display to kick the mail out without the user seeing it.
For info on the other bit, see the section on Automation Security. It's to do with the Outlook Security update for version of Outlook 98 and onwards.
HTH,
Chris.
.save
.send
instead of .display to kick the mail out without the user seeing it.
For info on the other bit, see the section on Automation Security. It's to do with the Outlook Security update for version of Outlook 98 and onwards.
HTH,
Chris.
#4
Scooby Regular
If you are in an Exchange environment to avoid the hassles with Outlook Automation Security, lay your hands on the old Exchange 5.0 client (more recently rebadged Windows Messaging Service) which conveniently leaves out all the security stuff. It's also quite a light install compared with Outlook bloat-ware.
Thread
Thread Starter
Forum
Replies
Last Post