ScoobyNet.com - Subaru Enthusiast Forum

ScoobyNet.com - Subaru Enthusiast Forum (https://www.scoobynet.com/)
-   Computer & Technology Related (https://www.scoobynet.com/computer-and-technology-related-34/)
-   -   MS Access - sending Email via Outlook (https://www.scoobynet.com/computer-and-technology-related-34/256693-ms-access-sending-email-via-outlook.html)

Jza 03 October 2003 04:19 PM

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" :o

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



ChrisB 03 October 2003 09:38 PM

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.

Jza 06 October 2003 10:22 AM

Your a star chris!

J

Miles 06 October 2003 12:34 PM

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.


All times are GMT +1. The time now is 03:31 PM.


© 2024 MH Sub I, LLC dba Internet Brands