首先我使用此代码删除outlook中的所有附件
For i = 1 To oMail.Attachments.Count
oMail.Attachments.Remove(i)
Next
我有4个附件,但我检查了oMail.Attachments.Count
它显示2
我在堆栈论坛中搜索此代码后
For Each a As outlook.Attachment In oMail.Attachments
a.Delete()
Next
删除1& 3附件但不删除2& 4附件
答案 0 :(得分:0)
尝试以下内容;
If oMail.Attachments.Count > 0 Then
For i = oMail.Attachments.Count To 1 Step -1
' Delete the attachment.
oMail.Attachments.Item(i).Delete
Next i
oMail.Save
End If
此LINK可能会为您提供更多详细信息。