Danny2015
New Member
- Outlook version
- Email Account
- POP3
Hi, I have following VBA codes which run properly for me most of time. However, I found a situation which cause the function doesn't work (the subject is not cut off the prefix "RE:" as supposed). When I am editing in Add Remind dialog, while an incoming mail is received in mailbox, the programme will fail.
My question is what is the reason, and what code should I add? I am grateful if somebody could kindly help me out, specially as I am nood in Outlook VBA.
'Cut off any standard prefix (like "RE:") of mail subject for any incoming mail
Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
Dim Utils, SPItem, varEntryIDs, NewSubJ, TempV
Dim i As Integer
Set Utils = CreateObject("Redemption.MAPIUtils")
Set SPItem = CreateObject("Redemption.SafePostItem")
varEntryIDs = Split(EntryIDCollection, ",")
For i = 0 To UBound(varEntryIDs)
Set SPItem.item = Application.Session.GetItemFromID(varEntryIDs(i))
NewSubJ = CutPrefix(SPItem.item.Subject)
TempV = Utils.HrSetOneProp(SPItem, &H70001F, NewSubJ, True) ' changes conversation
TempV = Utils.HrSetOneProp(SPItem, &H37001F, NewSubJ, True) ' changes subject
Next
Set Utils = Nothing
Set SPItem = Nothing
End Sub
Environment:
WinXP SP3
Outlook 2007 SP3
Redemption 5.8.0.4036
My question is what is the reason, and what code should I add? I am grateful if somebody could kindly help me out, specially as I am nood in Outlook VBA.
'Cut off any standard prefix (like "RE:") of mail subject for any incoming mail
Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
Dim Utils, SPItem, varEntryIDs, NewSubJ, TempV
Dim i As Integer
Set Utils = CreateObject("Redemption.MAPIUtils")
Set SPItem = CreateObject("Redemption.SafePostItem")
varEntryIDs = Split(EntryIDCollection, ",")
For i = 0 To UBound(varEntryIDs)
Set SPItem.item = Application.Session.GetItemFromID(varEntryIDs(i))
NewSubJ = CutPrefix(SPItem.item.Subject)
TempV = Utils.HrSetOneProp(SPItem, &H70001F, NewSubJ, True) ' changes conversation
TempV = Utils.HrSetOneProp(SPItem, &H37001F, NewSubJ, True) ' changes subject
Next
Set Utils = Nothing
Set SPItem = Nothing
End Sub
Environment:
WinXP SP3
Outlook 2007 SP3
Redemption 5.8.0.4036