无法从 Outlook.MailItem 中删除附件
我的 Outlook 插件检查(当用户单击“发送”时)是否附加了大附件。如果是这样,它应该删除它并取消发送并将焦点返回给用户。
这是我的 Outlook 插件代码的示例...
Private Sub ThisApplication_ItemSend(ByVal Item As Object, ByRef Cancel As Boolean) Handles Application.ItemSend
Dim mail As Outlook.MailItem = CType(Me.Application.ActiveInspector.CurrentItem, Outlook.MailItem)
For i As Integer = mail.Attachments.Count To 1 Step -1
mail.Attachments.Remove(i)
Next
Cancel = True
End Sub
活动邮件项目仍然显示所有附件。 :(
如何让 Outlook 删除所有附件(在用户发送邮件之前)并取消发送?
万分感谢!
Mojo
My Outlook addin checks (when user click "send") if a large attachment is attached. If so it should remove it and cancel the sending and give focus back to the user.
Here's a sample of my Outlook addin code...
Private Sub ThisApplication_ItemSend(ByVal Item As Object, ByRef Cancel As Boolean) Handles Application.ItemSend
Dim mail As Outlook.MailItem = CType(Me.Application.ActiveInspector.CurrentItem, Outlook.MailItem)
For i As Integer = mail.Attachments.Count To 1 Step -1
mail.Attachments.Remove(i)
Next
Cancel = True
End Sub
The active mail item still shows all the attachements. :(
How do I get Outlook to remove all the attachments (before user sends the mail) and cancel the sending?
Thanks a million!
Mojo
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这个:
Try this:
我知道老问题,但我在 Outlook 2010 中遇到了同样的问题并解决了。删除或删除对我都不起作用,直到我添加:
Old question I know but I have the same problem with Outlook 2010 and solved it. Neither Delete nor Remove worked for me until I added: