设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

12下一页
返回列表 发新帖
查看: 2644|回复: 15
打印 上一主题 下一主题

[查询] [求助]请问如何向查询结果里所有有Email地址的客户发Email

[复制链接]
跳转到指定楼层
1#
发表于 2006-6-15 04:10:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
请问一下大家,我要向我的客户数据库里有Email地址的客户发送资料。请问这样的功能如何实现?

例如说,我的客户数据库里有工程部门,市场部门等等。当我利用查询选出所有工程部门的记录,并且向他们发送Email。我能不能建一个按钮,将我查询到的所有结果里的Email地址传输到Outlook里,新建一封邮件,实现群发呢?还有一个小要求就是收件人不能看到我还将这个邮件发送给了其他的客户,也就是不显示收件人地址。

多谢了!
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
 楼主| 发表于 2006-6-15 07:10:00 | 只看该作者
有人知道吗?顶一下!
3#
发表于 2006-6-15 09:01:00 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
4#
发表于 2006-6-15 09:46:00 | 只看该作者
5#
发表于 2006-6-15 17:51:00 | 只看该作者
以下是微软网上的标准代码, 供你参考:

'Msoutl8.olb     
Sub SendMessage(DisplayMsg As Boolean, Optional AttachmentPath)
          Dim objOutlook As Outlook.Application
          Dim objOutlookMsg As Outlook.MailItem
          Dim objOutlookRecip As Outlook.Recipient
          Dim objOutlookAttach As Outlook.Attachment
          ' Create the Outlook session.
          Set objOutlook = CreateObject("Outlook.Application")
          ' Create the message.
          Set objOutlookMsg  = objOutlook.CreateItem(olMailItem)
          With objOutlookMsg
              ' Add the To recipient(s) to the message.
              Set objOutlookRecip = .Recipients.Add("Nancy Davolio")
              objOutlookRecip.Type = olTo
              ' Add the CC recipient(s) to the message.
              Set objOutlookRecip = .Recipients.Add("Michael Suyama")
              objOutlookRecip.Type = olCC
             ' Add the BCC recipient(s) to the message.
              Set objOutlookRecip = .Recipients.Add("Andrew Fuller")
              objOutlookRecip.Type = olBCC
             ' Set the Subject, Body, and Importance of the message.
             .Subject = "This is an Automation test with Microsoft Outlook"
             .Body = "This is the body of the message." &vbCrLf & vbCrLf
             .Importance = olImportanceHigh  'High importance
             ' Add attachments to the message.
             If Not IsMissing(AttachmentPath) Then
                 Set objOutlookAttach = .Attachments.Add(AttachmentPath)
             End If
             ' Resolve each Recipient's name.
             For Each ObjOutlookRecip In .Recipients
                 objOutlookRecip.Resolve
             Next
             ' Should we display the message before sending?
             If DisplayMsg Then
                 .Display
             Else
                 .Save
                 .Send
             End If
          End With
          Set objOutlook = Nothing
      End Sub

如果不想让别人看到MAIL发给了谁,请选BCC.

6#
 楼主| 发表于 2006-6-16 01:34:00 | 只看该作者
以下是引用Benjamin_luk在2006-6-15 9:51:00的发言:


以下是微软网上的标准代码, 供你参考:

'Msoutl8.olb     
Sub SendMessage(DisplayMsg As Boolean, Optional AttachmentPath)
          Dim objOutlook As Outlook.Application
          Dim objOutlookMsg As Outlook.MailItem
          Dim objOutlookRecip As Outlook.Recipient
          Dim objOutlookAttach As Outlook.Attachment
          ' Create the Outlook session.
          Set objOutlook = CreateObject("Outlook.Application")
          ' Create the message.
          Set objOutlookMsg  = objOutlook.CreateItem(olMailItem)
          With objOutlookMsg
              ' Add the To recipient(s) to the message.
              Set objOutlookRecip = .Recipients.Add("Nancy Davolio")
              objOutlookRecip.Type = olTo
              ' Add the CC recipient(s) to the message.
              Set objOutlookRecip = .Recipients.Add("Michael Suyama")
              objOutlookRecip.Type = olCC
             ' Add the BCC recipient(s) to the message.
              Set objOutlookRecip = .Recipients.Add("Andrew Fuller")
              objOutlookRecip.Type = olBCC
             ' Set the Subject, Body, and Importance of the message.
             .Subject = "This is an Automation test with Microsoft Outlook"
             .Body = "This is the body of the message." &vbCrLf & vbCrLf
             .Importance = olImportanceHigh  'High importance
             ' Add attachments to the message.
             If Not IsMissing(AttachmentPath) Then
                 Set objOutlookAttach = .Attachments.Add(AttachmentPath)
             End If
             ' Resolve each Recipient's name.
             For Each ObjOutlookRecip In .Recipients
                 objOutlookRecip.Resolve
             Next
             ' Should we display the message before sending?
             If DisplayMsg Then
                 .Display
             Else
                 .Save
                 .Send
             End If
          End With
          Set objOutlook = Nothing
      End Sub

如果不想让别人看到MAIL发给了谁,请选BCC.

请问这个代码怎么用啊?我完全是菜鸟一个,刚刚接触Access。
7#
发表于 2006-6-16 01:43:00 | 只看该作者
4楼不是由现成的例子吗?
8#
 楼主| 发表于 2006-6-16 01:55:00 | 只看该作者
以下是引用fan0217在2006-6-15 1:46:00的发言:


参考:http://www.office-cn.net/forum.php?mod=viewthread&tid=37148&replyID=&skin=1

我下载了,但是用不了,提示





点了确定以后又出现这个提示








然后出现使用界面,但是点任何的按钮都会弹出以上的提示。不过我觉得这个软件基本上能实现我要的功能。不知道楼上的能不能教教我怎么将这个程序移植到我的数据库来?多谢了!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
9#
发表于 2006-6-16 01:57:00 | 只看该作者
你检查是否有丢失的引用。

可查看其中的代码,里面有中文注释的。



对了,你的Office是什么版本的。

[此贴子已经被作者于2006-6-15 17:58:47编辑过]

10#
 楼主| 发表于 2006-6-16 02:05:00 | 只看该作者
版主在啊!

哦,我试试看。我的office是2003的,英文版。

是不是把5楼的原代码贴到我原来的那些代码里,然后改一些相应的引用啊什么的就行了?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-9-22 13:22 , Processed in 0.118750 second(s), 35 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表