Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub ConvertToPlain(MyMail As MailItem)
- Dim strID As String
- Dim objMail As Outlook.MailItem
- strID = MyMail.EntryID
- Set objMail = Application.Session.GetItemFromID(strID)
- objMail.BodyFormat = olFormatPlain
- objMail.Save
- Set objMail = Nothing
- End Sub
- Sub RemoveAttachments()
- Dim myAttachment As Attachment
- Dim myAttachments As Attachments
- Dim selItems As Selection
- Dim myItem As Object
- Dim lngAttachmentCount As Long
- ' Set reference to the Selection.
- Set selItems = ActiveExplorer.Selection
- ' Loop though each item in the selection.
- For Each myItem In selItems
- Set myAttachments = myItem.Attachments
- lngAttachmentCount = myAttachments.Count
- ' Loop through attachments until attachment count = 0.
- While lngAttachmentCount > 0
- myAttachments(1).Delete
- lngAttachmentCount = myAttachments.Count
- Wend
- myItem.Save
- Next
- MsgBox "All Done. Attachments were removed.", vbOKOnly, "Message"
- Set myAttachment = Nothing
- Set myAttachments = Nothing
- Set selItems = Nothing
- Set myItem = Nothing
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement