Hi,
I wonder if anyone can help me with this problem I have been getting.
I wrote a macro in Outlook that strips unwanted text from the Subject line, here it is:
Sub CleanDC()
Dim OutlookApp As Outlook.Application
Dim myNamespace As Outlook.NameSpace
Dim myItems As Outlook.Items
Dim myItem As Outlook.MailItem
Dim dcFolder As Outlook.MAPIFolder
Dim s As String
Set OutlookApp = CreateObject("Outlook.Application")
Set myNamespace = OutlookApp.GetNamespace("MAPI")
Set dcFolder = myNamespace.GetDefaultFolder(olFolderInbox).Folders("Lists").Folders("DC")
Set myItems = dcFolder.Items.Restrict("Not ([Categories] = 'Cleaned')")
For Each myItem In myItems
If (myItem.Class = olMail) Then
s = myItem.Subject
If (InStr(1, s, "[DC]", vbTextCompare) > 0) Then
s = Replace(s, "[DC]", "", 1, -1, vbTextCompare)
s = Replace(s, "re:", "", 1, -1, vbTextCompare)
s = Replace(s, "fwd:", "", 1, -1, vbTextCompare)
s = Replace(s, "[]", "", 1, -1, vbTextCompare)
s = Replace(s, " ", " ", 1, -1, vbTextCompare)
s = Trim(s)
myItem.Subject = s
myItem.Categories = "Cleaned"
myItem.Save
End If
End If
Next
MsgBox "Done"
End Sub
The macro seems to work fine, except that when I close Outlook and then open it again I get the following error:
Outlook experienced a serious error the last time the add-in 'microsoft vba for outlook addin' was opened. Would you like to disable this add-in
To reactivate this add-in, click About Microsoft Office Outlook on the Help menu, and then click Disabled Items
I have created a self-signed certificate and I have added it to my certificate store, I then signed the project with the certificate.
What am I missing
Any help would be greatly appreciated.
Thanks,
Andre

Outlook experienced a serious error: 'microsoft vba for outlook addin'
blackwidow25
Hi Andre,
Here's the response from the support engineer:
I have tried to reproduce the issue. But I failed to do it.
I tested it in Office 2003. I tried it by last steps:
1. Copy/paste the code in the VBA
2. I create a folder Lists and a folder DC
3. I send me a mail with the subject “[DC]re:text”
4. Move the mail in the folder DC
5. Run the script.
6. Close the Outlook.
7. Open the Outlook.
I don’t get any error.
Would you please ask our ISV to check the issue
1. Is there any thing important I missed in my steps.
2. Is there any error logs in the event view
3. Is there any detail information of the add-in
-brenda (ISV Buddy Team)