I have a report in MS Access 2007 and I would like to send this report as pdf automatically every night without asking a user to run the macro manually or so. I have the following code in a macro:

```
    Dim strRecipient As String
    Dim strSubject As String
    Dim strMessageBody As String

    strRecipient = "emailaddr...@domain.com"
    strSubject = "This is the email subject"
    strMessageBody = "Here is a whole bunch of interesting text to accompany the   attachment."

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

```

In google, it says I can then name this macro as autoexec and use windows task scheduler. However, this does not work in my case becase when I run the code above, I get a security warning message from outlook saying "a program is trying to automatically send email on your behalf
do you want to allow this? if this is unexpected it may be virus and you should choose no"

I don't want this message to appear because I don't want a confirmation from a user since the plan is to send this email automatically at night. Any help will be appreciated!
Thanks in advance,