访问问题的电子邮件自动化 [英] Email Automation from Access Problem

查看:76
本文介绍了访问问题的电子邮件自动化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我正在尝试为我们的数据库添加一项自动发送电子邮件的功能。

输入新订单时,我想要选项向订单所在的公司发送电子邮件,附上我们的工作订单副本。


我要附加的文件是由Access创建的富文本文档并存储在我们的服务器上创建此文档不是问题。


问题是让电子邮件选项工作。它似乎不起作用。实际上,它根本不做什么,甚至都没有错误消息。


以下代码只是我的Add New上命令按钮的On Click事件的VBA的一部分订单形式。点击按钮可以完成几件事,所有这些都可以正常工作。我尝试将电子邮件选项添加到该按钮单击时发生的事件列表。

Hi all,

I am trying to add a feature to our database that automates sending emails.
When entering a new order, I want the option to send an email to the company the order came from, attaching a copy of our work order.

The file that I want to attach is a rich text document created by Access and stored on our server. The creation of this document is not the problem.

The problem is getting the email option to work. It does not seem to work. In fact, it just does nothing at all, not even an error message.

The following code is just part of the VBA for an On Click event for a command button on my Add New Orders form. The button click does several things, all of which work fine. I tried to add the email option to the list of events that occur on that button click.

展开 | 选择 | Wrap | 行号

推荐答案




我通常在我要检查的代码之前放置STOP然后运行它并在大多数情况下使用F8逐步检查代码它解决了我的问题直接发布。


希望它有所帮助

Emil
Hi

I normally put STOP before the code I want to check then run it and use F8 to check the code step by step in majority of cases it resolves my issues straight away.

Hope it helps
Emil


我对Outlook自动化没有多少经验,但我可以给出一些概念的链接。通过代码调试,让你告诉我们哪些不起作用听起来像个好主意。这个级别的代码不容易查看和发现问题,特别是在没有相关领域的特定经验的情况下。

调试Application Automation时,它有助于将Application对象设置为可见。它开始是不可见的,但在第24行之后添加此代码应该有所帮助:
I don''t have much experience with Outlook automation, but I can give links to some concepts. Debugging through the code to enable you to tell us what is not working does sound like a good idea. This level of code is not so easy to look through and spot problems, especially without specific experience in the relevant area.

When debugging Application Automation it helps to set the Application object to visible first. It starts off invisible but adding this code after line #24 should help :
展开 | 选择 | Wrap | 行号


你好,


我相信 - 至少部分问题 - 可能存在于DLOOKUP中......


stRecip = DLookup(" email"," cust" ,[cusname] =''"& Me!ORDER&"''")


Where" email"应该在括号中[email] ...


您可能还需要在名称比较中非常小心并使用修剪
Hi there,

I believe - at least part of your problem - may reside in the DLOOKUP ...

stRecip = DLookup("email", "cust", "[cusname]=''" & Me!ORDER & "''")

Where "email" should be in brackets "[email]" ...

You may also want to be very careful in name comparisons and use the Trim


这篇关于访问问题的电子邮件自动化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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