Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6110601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:32:04+00:00 2026-05-23T14:32:04+00:00

I am trying to auto email a report from access using VBA in a

  • 0

I am trying to auto email a report from access using VBA in a macro. The report is sent from Access2007 by outlook2007. When the report is being sent, I get a security message from outlook saying “a program is trying to access your Address book or Contacts” or “a program is trying to access e-mail addresses you have stored in Outlook…” . This message is a problematic for me because I want to use windows task scheduler to automatically send the report without any human interaction.So I want to disable this security notification. I searched on Google and here is the code I have so far but giving me errors and I am not sure what else I should do. Thanks for your help in advance. I am a beginner programmer. The error is

Public Sub Send_Report()
Dim strRecipient As String
Dim strSubject As String
Dim strMessageBody As String
Dim outlookapp As Outlook.Application

Set outlookapp = CreateObject("Outlook.Application")

OlSecurityManager.ConnectTo outlookapp   'error is here says object required

OlSecurityManager.DisableOOMWarnings = True
On Error GoTo Finally

strRecipient = "example@yahoo.com"
strSubject = "Tile of report"
strMessageBody = "Here is the message."

DoCmd.SendObject acSendReport, "Report_Name", acFormatPDF, strRecipient, , ,        strSubject, strMessageBody, False

Finally:
OlSecurityManager.DisableOOMWarnings = False


End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:32:04+00:00Added an answer on May 23, 2026 at 2:32 pm

    You get the error because OlSecurityManager is nothing. You haven’t declared it, you haven’t set it to anything, so when you attempt to use it, VBA has no idea what you’re talking about!

    It looks like you’re trying to use Outlook Security Manager, which is an add-in sold here. Have you purchased it? Because if not, then you probably don’t have it on your system.

    If you do have it, then you probably need to declare and set it like this:

    Dim OlSecurityManager As AddinExpress.Outlook.SecurityManager
    Set OlSecurityManager = New AddinExpress.Outlook.SecurityManager
    

    If you, as I suspect, don’t have it, then an alternative is sending e-mail using CDO. Here’s an example:

    First, set a reference to the CDO library in Tools > References > checkmark next to Microsoft CDO for Windows Library or something like that.

    Dim cdoConfig
    Dim msgOne
    
    Set cdoConfig = CreateObject("CDO.Configuration")
    With cdoConfig.Fields
        .Item(cdoSendUsingMethod) = cdoSendUsingPort
        .Item(cdoSMTPServerPort) = 25 'your port number, usually is 25
        .Item(cdoSMTPServer) = "yourSMTPserver.com" 
        '.Item(cdoSendUserName) = "your username if required"
        '.Item(cdoSendPassword) = "your password if required"
        .Update
    End With
    
    Set msgOne = CreateObject("CDO.Message")
    With msgOne
        Set .Configuration = cdoConfig
        .To = "recipient@somehwere.com"
        .from = "you@here.com"
        .subject = "Testing CDO"
        .TextBody = "It works just fine."
        .Attachments.Add "C:\myfile.pdf"
        .Send
    End With
    

    This is a bit more annoying than Outlook, because you need to know in advance the address of the SMTP server to be used.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to auto-generate a plain text email with a trademark symbol in it.
I'm trying to make an auto-login using Greasemonkey. Can anyone help me? Relevant HTML
I am trying to auto-load classes from the lib directory inside of one specific
I'm trying to create an auto-updating app using Winforms. I can't use click-once or
How to disable qt creator from auto building when trying to debug? Currently when
Hi I have been trying to implement auto complete in my site from 2
I am trying to get the emails I send through Gmail from my Ruby
I am trying to auto fill a form (currently using contact form 7) with
im trying to getting auto complete working and i can do so fine when
I was trying to write code that would auto-close a Toplevel Tk window in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.