The use case is I am a developer that makes Minecraft plugins for people. I tell them if they have issues to use a webform I made. The form emails a special email, and I have an Outlook rule that moves those emails to a PST. What I do is run a C# program I wrote that parses the PST and when I mark the issue as resolved, it edits the message subject and does "[DONE] " + subject so the next time I open it and scan, it won't display that.
So what I'm confused about is, how do I edit the record to update the message subject? If I can't, I saw the OutlookFolder object has a RemoveItem method. I am fine with just deleting the messages from the folder if needs be, but I can't find the entry ID byte[] to pass to it. When I read I'm doing:
- Code: Select all
public static List<SupportQuestion> GetSupportQuestion(string pstfile) {
try {
if (!File.Exists(pstfile)) {
Dialog("Invalid PST file!");
return new List<SupportQuestion>();
}
List<SupportQuestion> records = new List<SupportQuestion>();
OutlookFile outlookFile = new OutlookFile(pstfile);
OutlookFolder folder = outlookFile.GetFolder("Questions");
IEnumerable<OutlookItem> items = folder.EnumerateOutlookItem();
foreach (var item in items) {
// I use the data from item here to create a SupportQuestion object and add to the list
}
return records;
} catch (Exception ex) {
Dialog("** Exception during GetSupportQuestion:\n\n" + ex.Message);
return new List<SupportQuestion>();
}
}
In the loop if I do item. and read the available properties, I don't see anything that sounds right.
Can someone clarify? Ideally on how to edit a subject, but failing that how to get the entry ID for a messaging whilst looping the enumerated Outlook items as I am.
Thanks a lot!