Outlook Mailitem附件计数在Reply和Forward中返回不同

时间:2018-02-22 07:30:44

标签: vba outlook attachment outlook-vba

Windows 10 Pro 1703,Outlook 2016 64位

我想计算回复/转发邮件中的附件,图片,形状数量。

我发现回复和转发消息中的项目返回数量不同。

realm_access: {roles: [offline access,uma authorization] } }

在功能区或快速访问工具栏中添加Function AttachmentImageShapeCount() Dim myItem As Outlook.MailItem Dim doc As Document Select Case TypeName(Application.ActiveWindow) Case "Explorer" Set myItem = ActiveExplorer.ActiveInlineResponse Case "Inspector" Set myItem = Application.ActiveInspector.CurrentItem End Select If Not myItem Is Nothing Then Set doc = myItem.GetInspector.WordEditor AttachmentImageShapeCount = myItem.Attachments.Count + doc.InlineShapes.Count + doc.Shapes.Count Debug.Print "Attachment: " & myItem.Attachments.Count Debug.Print "Image: " & doc.InlineShapes.Count Debug.Print "Shapes: " & doc.Shapes.Count End If Set myItem = Nothing End Function Sub PrintNonTextItem() Debug.Print "Total: " & AttachmentImageShapeCount() End Sub 宏。

如果邮件包含图像或形状,则“回复”和“转发”邮件中附件的数量会有所不同。

很奇怪,或者我的代码有bug?

0 个答案:

没有答案