作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 Outlook 中内置了一个自定义表单,可以在任何更改时发送电子邮件通知。由于表单的规范,我不得不在表单中添加一些 VBScript(不幸的是)在表单的关闭事件上发送电子邮件。
该表格目前已发布并且运行良好。唯一出现的问题是 我是唯一的用户 使用表格 出现以下对话框提示:
使用该表单的其他人都无法获得该对话框。 此对话框强制您等到进度条完成,然后才“允许”您发送电子邮件(大约 5 秒)。 是因为我是出版商吗?还是我遇到的客户端设置? 如何禁用这只小狗?
如果其相关,请引用来源:
Sub SendAttach()
'Open mail, adress, attach report
Dim objOutlk 'Outlook
Dim objMail 'Email item
Dim strMsg
Const olMailItem = 0
'Create a new message
set objOutlk = createobject("Outlook.Application")
set objMail = objOutlk.createitem(olMailItem)
objMail.To = Item.UserProperties("Assigned To")
objMail.cc = Item.UserProperties("Bcc")
'Set up Subject Line
objMail.subject = "Work Order Notifications: " & Item.UserProperties("Work Order Number") & " - " & _
Item.UserProperties("Subject") & " Due " & Item.UserProperties("Due Date")
'Add the body
strMsg = Item.UserProperties("Specifications") & vbcrlf
strMsg = strMsg & Item.UserProperties("Constraints")
objMail.body = strMsg
objMail.display 'Use this to display before sending, otherwise call objMail.Send to send without reviewing
objMail.Send
'Clean up
set objMail = nothing
set objOutlk = nothing
End sub
最佳答案
我在尝试完成一些稍微不同的事情时遇到了这个问题,但为此目的是相同的。 HK 提供的链接可以很好地阅读并有助于了解正在发生的事情,但最终我选择不使用页面上讨论的任何选项。相反,我保持简单并决定让 Outlook 认为我正在发送电子邮件而不是自动过程,我这样做是通过将 objMail.Send 替换为 SendKeys 替代来模仿自己按下发送按钮,有点丑但有效就我而言。
编辑:
您可以使用此 sendkeys 语句:
SendKeys "%{s}", 1
关于vbscript - 是什么导致 Outlook 2007 提示 "A program is trying to send an e-mail message on your behalf?",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10455665/
我是一名优秀的程序员,十分优秀!