Creating Email from Access 2003 vba

srbond

New member
Local time
Today, 18:58
Joined
Jul 30, 2010
Messages
2
Hi,

I am writing code which creates an Outlook email, sets the importance level, fills in subject, body, etc.

The issue I have is when I programatically add recipients - I get a warning that states "A programs is trying to access e-mail addresses you have stored in Outlook. Do you want to allow this?"

I found code to disable this warning: OlSecurityManager.DisableOOMWarnings = True

BUT this code uses early binding (references). In order to avoid version issues, I want to use late binding.

Any ideas how to convert OlSecurityManager.DisableOOMWarnings = True to late binding?

Thanks


My entire function code is below:

--------------------------------------

Function fSetOutlookTask() As Boolean

'Set up the variables
Dim olApp As Object
Dim olMail As Object


Const olMailItem As Long = 0
Const olImportanceNormal As Long = 1
Const olImportanceHigh As Long = 2
Const olSave As Long = 0

Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(olMailItem)


With olMail

.Subject = "Subject"

.Importance = olImportanceHigh

.Recipients.Add "xxxx@hotmail.com"
''OlSecurityManager.DisableOOMWarnings = True


.Body = "BODY: " & vbNewLine & vbNewLine
.display


End With



'Cleanup

Set olMail = Nothing
Set olApp = Nothing


End Function


--------------------------------------
 
Complex subject you have here.

Access 2003 and if you are using XP require "Redemption" to get around this problem.

Access 2007/10 and Vista/Win 7 use Trust Centres to manage this problem and avoid the need to use Redemption.

There is lots of stuff on this site to do with eMailing from Access - some of which is mine. Too much to comment here but either run with the problem if it is always just a few eMails; otherwise use Redemption.

I agree with the previous that Outlook Security Manager is not appropriate for Access 2003 - remove that line.
 
He He - the solution is here in the Section Create the multivalued lookup based on a table or query:

office.microsoft.com/en-gb/access-help/guide-to-multivalued-fields-HA001233722.aspx#BM5

I can easily run a piece of code to Flag the Matched groups.
 
To get around this warning message you can install CDO and send directly from your SMTP server bypassing Outlook completely. For more information on this, please see my comment in this thread - http://www.access-programmers.co.uk/forums/showthread.php?p=923411#post923411

To install CDO, go to Start>Settings>Control Panel>Add or Remove programs. With "Change or Remove Programs" selected, scroll down the list of currently installed programs, highlight Microsoft Office and press "Change" - this opens up Microsoft Office Setup.

Select the "Add or Remove features" radio button and press "Next".

Press the + button next to Microsoft Outlook

Click on the drop down list next to "Collaboration Data Objects" and select "Run all from My Computer".

Press Update - this installs CDO.

Make sure to set your references after
 

Users who are viewing this thread

Back
Top Bottom