【发布时间】:2014-08-27 10:59:12
【问题描述】:
我在 MS Access 2007 中有一份报告,我想每晚自动将此报告作为 pdf 发送,而不要求用户手动运行宏。我在宏中有以下代码:
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
在谷歌中,它说我可以将此宏命名为 autoexec 并使用 Windows 任务调度程序。但是,这在我的情况下不起作用,因为当我运行上面的代码时,我从 Outlook 收到一条安全警告消息,说“程序正在尝试代表您自动发送电子邮件 你想允许吗?如果这是意外情况,则可能是病毒,您应该选择“否”
我不希望显示此消息,因为我不希望用户确认,因为计划是在晚上自动发送此电子邮件。任何帮助将不胜感激! 提前致谢,
【问题讨论】:
标签: ms-access