[C#][VSTO] Generating Unique ID Alongside Subject Line


I'm working on a program for Outlook that generates a Base62 ID, when the user activates the Addin Ribbon the program generates an ID and places it within the subject line alongside previous text the user added.


I'm having trouble with the ID replacing all text within the Subject Line, I've tried a few methods but none seem to work. Can anyone give me advice on how to move to forward?

Preferred Output

This is a subject line (Base62 ID)

Click Event

string Base62 = Base62Random(); var inspector = this.Context as Outlook.Inspector; var currentMailItem = inspector.CurrentItem as Outlook.MailItem; currentMailItem.Subject = currentMailItem.Subject+"(" +Base62.ToUpper()+")";

by ThrowawayRailek via /r/csharp

Leave a Reply