通过CDO和附件发送邮件 [英] Send mail by CDO and attachments

查看:118
本文介绍了通过CDO和附件发送邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Access 2003.我有一个包含截止日期数据的数据库。我设置了数据库,为每个在特定时间范围内有截止日期的人创建报告。我需要自动化数据库,以便在报告存在时发送电子邮件,但如果没有人员报告,则不会发送电子邮件。我有CDO代码,除了不发送部分外,效果很好。以下是代码的一部分。任何帮助,将不胜感激。谢谢!

展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号

解决方案

我想我不明白问题出在哪里所在。您说您将数据库设置为仅在存在截止日期时生成报告,那么为什么您不希望在没有报告时触发代码?你是如何调用代码开始的?


问候,

Scott



我想我不明白问题出在哪里。您说您将数据库设置为仅在存在截止日期时生成报告,那么为什么您不希望在没有报告时触发代码?你是如何调用代码开始的?


问候,

Scott



数据库为每个可能有或没有最后期限的程序人员运行查询。如果他们有截止日期,则会创建报告。如果他们没有生成报告。我的代码目前正在说创建和发送电子邮件并将附件发送给该人,然后它为下一个人调用代码,依此类推。如果其中一个人(我打电话约15个潜水员)没有附加报告,我不希望收到他们的电子邮件。希望澄清事情。我可以在不使用CDO但是想要使用CDO时这样做,所以我没有得到Outlook警告。

希望你能帮帮忙。我不明白为什么应该停止发送的代码的一部分不起作用。

展开 | 选择 | 换行 | 行号


抛出

展开 | 选择 < span class =codeDivider> | Wrap | 行号


Hi, Access 2003. I have a DB that contains deadlines data. I have the DB set up to create a report for each person that has deadline within a certain time frame. I need to automate the DB so an email is sent when a report exists but an email is not sent if there is no report for people. I have CDO code that works great except for the do not send part. The following is that part of the code. Any help would be appreciated. Thanks!

Expand|Select|Wrap|Line Numbers

解决方案

I guess I''m not understanding where the problem lies. You say you have the database set up to only generate a report when there exists a deadline, then why do you want to not fire the code when there is no report? How are you calling the code to begin with?

Regards,
Scott


I guess I''m not understanding where the problem lies. You say you have the database set up to only generate a report when there exists a deadline, then why do you want to not fire the code when there is no report? How are you calling the code to begin with?

Regards,
Scott

The DB runs a query for each of the program folks that could or could not have deadlines. If they have a deadline, a report is created. If they don''t a report is not generated. My code is currently saying create and email and send the attachment to that person then it calls code for the next person and so on. If one of the people (I call about 15 subs) does not have a report to attach, I do not want an email going out to them. Hope that clarifies things. I can do it when not using CDO but want to use CDO so I don''t get the Outlook warnings.
Hope you can help out. I don''t get why that one part of the code that should stop the sending doesn''t work.

Expand|Select|Wrap|Line Numbers


Throw in a

Expand|Select|Wrap|Line Numbers


这篇关于通过CDO和附件发送邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆