简体   繁体   English

如何访问大型附件 BeforeAttachmentWriteToTempFile In Outlook AddIn

[英]How to access a large attachment BeforeAttachmentWriteToTempFile In Outlook AddIn

I'm trying to intercept an attachment being added to a message in an Outlook plugin.我正在尝试拦截添加到 Outlook 插件中消息的附件。 Outlook/Exchange settings blocking large attachments, and I have found that when using the Attach button or dragging and dropping files to attach the "BeforeAttachmentWriteToTempFile" event fires BEFORE the message is displayed. Outlook/Exchange 设置阻止大型附件,我发现当使用“附加”按钮或拖放文件附加“BeforeAttachmentWriteToTempFile”事件时,会在显示消息之前触发。 This is great, it allows you to Cancel attach process before the message is display.这很棒,它允许您在显示消息之前取消附加过程。

However the problem is the Attachment Object passed to this Event throws COM exceptions when trying to get the FilePath or GetTemporaryFilePath.但是,问题是传递给此事件的附件 Object 在尝试获取 FilePath 或 GetTemporaryFilePath 时抛出 COM 异常。 It also has a null DisplayName and 0 Size.它还具有 null DisplayName 和 0 Size。 I'd like to be able to access the filePath of the item that was attempted to attached我希望能够访问试图附加的项目的文件路径

我得到的错误

You can instead try to bypass the large attachment limitation to avoid Outlook prompt, and deal with the large attachment only after it can be accessed/modified.您可以尝试绕过大附件限制以避免 Outlook 提示,只有在可以访问/修改后才处理大附件。 See Bypass/Ignore Exchange Server "Maximum Send Size"?请参阅绕过/忽略 Exchange 服务器“最大发送大小”?

Use the MailItem.BeforeAttachmentAdd event instead.请改用MailItem.BeforeAttachmentAdd事件。 It is fired before an attachment is added to an Outlook item.它在将附件添加到 Outlook 项目之前触发。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM