通过电子邮件发送Access创建的PDF文件... [英] emailing a PDF file created by Access...

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

问题描述

我打印到创建PDF的设备。知道了文件名后,怎么能把b / b
嵌入到OutLook Express出站的正文中

email&发送到表中的指定地址?我希望收件人

收件人在他们打开电子邮件的正文文本窗口中查看报告

。我还在考虑将PDF文件附加到电子邮件中,以获取那些只有仅文本的电子邮件。电子邮件软件我需要

从VB过程自动完成这两个任务。想法?

解决方案

MLH< CR ** @ NorthState.net>写道:

我打印到创建PDF的设备。知道文件名后,我怎么能将PDF嵌入到OutLook Express出站的正文电子邮件中。发送到表中的指定地址?我希望收件人
收件人在他们打开电子邮件的正文文本窗口中查看报告。我还在考虑将PDF文件附加到电子邮件中,以获取那些只有仅文本的电子邮件。电子邮件软件我需要从VB过程自动执行这两个任务。想法?




AFAIK你不能在电子邮件正文中嵌入一个文件。你需要使用很多VBA代码自己创建

HTML /文本字符串。


要创建一个格式化的文档作为电子邮件发送你将需要使用VBA代码

创建一个较大的字符串。然后,此字符串将作为电子邮件正文传递给SendObject命令

。有关详细信息,包括样本航空代码,请参阅我的提示

页面,主题为 www.granite.ab.ca/access/emailformatted.htm


Tony

-

Tony Toews,Microsoft Access MVP

请仅在新闻组中回复,以便其他人可以阅读整个帖子消息。

Microsoft Access Links,Hints,Tips&会计系统
http://www.granite.ab.ca /accsmstr.htm


Tony,感谢您的回复。我有一个类似的挑战,除了

我想要做的就是将插入和HTML编码的消息插入到Outlook

中,以便HTML正确呈现以便显示

消息被发送,就像你在

Outlook中切换到HTML模式一样,手动完成所有格式化输入消息,

颜色,字体等。现在我可以发送短信

(包括使用

后期绑定的Access 2K程序的Outlook代码中的HTML代码操作OL对象moc\del。但是当我向Outlook发送

HTML代码时,HTML标记全部出现在

消息的正文中而不是被转换可读格式。我有

Outlook设置为默认为HTML的新消息。


有什么建议吗?


感谢您对这个团队的出色贡献。


--W


周六,2003年9月6日21:54:42 GM T,Tony Toews< tt **** @ telusplanet.net>

写道:

MLH< CR ** @ NorthState.net>写道:

我打印到创建PDF的设备。知道文件名后,我怎么能将PDF嵌入到OutLook Express出站的正文电子邮件中。发送到表中的指定地址?我希望收件人
收件人在他们打开电子邮件的正文文本窗口中查看报告。我还在考虑将PDF文件附加到电子邮件中,以获取那些只有仅文本的电子邮件。电子邮件软件我需要从VB过程自动执行这两个任务。想法?



AFAIK你不能在电子邮件正文中嵌入一个文件。您需要使用大量VBA代码自己创建
HTML /文本作为字符串。

要创建格式化文档以作为电子邮件发送,您将需要使用VBA代码。有关详细信息,包括样本航空代码,请参阅本主题的提示页面 www.granite.ab.ca/access/emailformatted.htm

Tony




MLH< CR ** @ NorthState.net>在消息新闻中写道:< gk ******************************** @ 4ax.com>。 ..

我打印到创建PDF的设备。知道文件名后,我怎么能将PDF嵌入到OutLook Express出站的正文电子邮件中。发送到表中的指定地址?我希望收件人
收件人在他们打开电子邮件的正文文本窗口中查看报告。我还在考虑将PDF文件附加到电子邮件中,以获取那些只有仅文本的电子邮件。电子邮件软件我需要从VB过程自动执行这两个任务。 IDEAS?




Express不会暴露任何对象,所以你不能直接自动化它。
。您可以使用CDO库或

来完成它。你应该可以在MS

网站上找到类似的东西。寻找像CDONTS.DLL之类的东西。如果我没记错的话,

它只是一个MAPI包装器,所以应该可行。然后,一旦你安装并注册了

,做你要求的是微不足道的。


在子/函数中执行以下操作:

创建新邮件。

指定正文文本。但是不知道你是如何粘贴PDF的。

如果你要添加普通文本,那就快点了。

添加你想要的任何附件。 (PDF)

指定收件人...打开你的

函数内的收件人记录集(或作为参数传递),然后通过它们循环添加

他们到收件人集合。

如果一切都是您想要的方式,请发出

消息对象的.Send命令。 />


I print to a device that creates a PDF. Knowing the filename, how can
I then embed the PDF into the body text of an OutLook Express outbound
email & send to a specified address in a table? I want recipient
addressees to see the report in the body text window of their email
when they open it. I was thinking also about attaching the PDF file to
the eMail for those having "text only" email software. I need to
automate both of these tasks from a VB procedure. IDEAS?

解决方案

MLH <CR**@NorthState.net> wrote:

I print to a device that creates a PDF. Knowing the filename, how can
I then embed the PDF into the body text of an OutLook Express outbound
email & send to a specified address in a table? I want recipient
addressees to see the report in the body text window of their email
when they open it. I was thinking also about attaching the PDF file to
the eMail for those having "text only" email software. I need to
automate both of these tasks from a VB procedure. IDEAS?



AFAIK you can''t embed a file in the body of an email. You will need to create the
HTML/text as a string yourself using much VBA code.

To create a formatted document to send as an email you will need to use VBA code to
create a largish string. This string will then be passed to the SendObject command
as the body of the email. For more details including sample air code see my Tips
page on this topic at www.granite.ab.ca/access/emailformatted.htm.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm


Tony, Thanks for this response. I have a similar challenge, except
that all I want to do is insert and HTML encoded message into Outlook
in such a way that the HTML is rendered properly for display when the
message is sent, just like it would be if you switched to HTML mode in
Outlook and entered the message manually complete with all formatting,
colors, fonts, etc. Right now I''m able to send text messages
(including HTML code to Outlook from an Access 2K procedure that uses
late binding to manipulate the OL object moc\del. But when I send
HTML code to Outlook, the HTML tags all appear in the body of the
message instead of being converted to readable format. I DO have
Outlook set up to default to HTML for new messages.

Any suggestions?

Thanks for your excellent contributions to this group.

--WC

On Sat, 06 Sep 2003 21:54:42 GMT, Tony Toews <tt****@telusplanet.net>
wrote:

MLH <CR**@NorthState.net> wrote:

I print to a device that creates a PDF. Knowing the filename, how can
I then embed the PDF into the body text of an OutLook Express outbound
email & send to a specified address in a table? I want recipient
addressees to see the report in the body text window of their email
when they open it. I was thinking also about attaching the PDF file to
the eMail for those having "text only" email software. I need to
automate both of these tasks from a VB procedure. IDEAS?



AFAIK you can''t embed a file in the body of an email. You will need to create the
HTML/text as a string yourself using much VBA code.

To create a formatted document to send as an email you will need to use VBA code to
create a largish string. This string will then be passed to the SendObject command
as the body of the email. For more details including sample air code see my Tips
page on this topic at www.granite.ab.ca/access/emailformatted.htm.

Tony




MLH <CR**@NorthState.net> wrote in message news:<gk********************************@4ax.com>. ..

I print to a device that creates a PDF. Knowing the filename, how can
I then embed the PDF into the body text of an OutLook Express outbound
email & send to a specified address in a table? I want recipient
addressees to see the report in the body text window of their email
when they open it. I was thinking also about attaching the PDF file to
the eMail for those having "text only" email software. I need to
automate both of these tasks from a VB procedure. IDEAS?



Express does not expose any objects, so you cannot automate it
directly. You might be able to do it using the CDO libraries or
something. You should be able to find something like that at the MS
website. Look for something like "CDONTS.DLL". If I remember right,
it''s just a MAPI wrapper, so it should work. Then once you have that
installed and registered, doing what you ask is trivial.

In a sub/function do the following:
Create a new mail message.
Specify the body text. Not sure how you''d paste in the PDF, though.
If you were adding normal text, it would be a snap.
Add any attachments you want. (the PDF)
specify the recipients... open a recordset of recipients inside your
function (or pass it in as an argument), then loop through them adding
them to the Recipients collection.
When everything is the way you want it, issue the .Send command of the
message object.


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

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