Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

MS Access - sending Email via Outlook

Thread Tools
 
Search this Thread
 
Old 03 October 2003, 04:19 PM
  #1  
Jza
Scooby Regular
Thread Starter
 
Jza's Avatar
 
Join Date: Feb 2001
Posts: 2,959
Likes: 0
Received 0 Likes on 0 Posts
Question

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


Old 03 October 2003, 09:38 PM
  #2  
ChrisB
Moderator
 
ChrisB's Avatar
 
Join Date: Dec 1998
Location: Staffs
Posts: 23,573
Likes: 0
Received 0 Likes on 0 Posts
Post

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.
Old 06 October 2003, 10:22 AM
  #3  
Jza
Scooby Regular
Thread Starter
 
Jza's Avatar
 
Join Date: Feb 2001
Posts: 2,959
Likes: 0
Received 0 Likes on 0 Posts
Post

Your a star chris!

J
Old 06 October 2003, 12:34 PM
  #4  
Miles
Scooby Regular
 
Miles's Avatar
 
Join Date: Oct 1998
Location: The Granite City/Dallas, Tx.
Posts: 2,519
Likes: 0
Received 0 Likes on 0 Posts
Post

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.
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
JimBowen
ICE
5
02 July 2023 01:54 PM
TylerD529
General Technical
2
09 October 2015 01:53 AM
wms-racing
Wanted
0
28 September 2015 10:05 AM
Littleted
Computer & Technology Related
4
25 September 2015 09:55 PM



Quick Reply: MS Access - sending Email via Outlook



All times are GMT +1. The time now is 02:48 PM.