Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub RemoveGarbageText()
- ' Removes garbage text from outlook meeting invitation titles. Great for fighting automatic email subject tagging utilized by some companies.
- ' 2019-10-23 by giny8i8 (stolen from the internet somewhere, I can't recall where... :(
- ' This script replaces the word [EXTERNAL] to nothing
- ' Make sure you set the chracter count properly for the text you want to replace in the "Mid()" function. For the word [EXTERNAL] it is:
- ' Mid(Item.Subject, 1, 10)
- Dim myolApp As Outlook.Application
- Dim calendar As MAPIFolder
- Dim aItem As Object
- Set myolApp = CreateObject("Outlook.Application")
- Set calendar = myolApp.ActiveExplorer.CurrentFolder
- Dim iItemsUpdated As Integer
- Dim strTemp As String
- iItemsUpdated = 0
- For Each Item In calendar.Items
- If Mid(Item.Subject, 1, 10) = "[EXTERNAL]" Then
- strTemp = Replace(Item.Subject, "[EXTERNAL]", "")
- Item.Subject = strTemp
- iItemsUpdated = iItemsUpdated + 1
- End If
- Item.Save
- Next Item
- MsgBox iItemsUpdated & " of " & calendar.Items.Count & " Meetings Updated"
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement