T
Tim Attwood
How can I set the sent flag (and sendername etc) for a newly created
MailItem.
This is what I have so far but it doesn't work :-(
MAPIFolder oInbox =
mNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox) ;
MailItem oItem =
(MailItem)mApplicationObject.CreateItemFromTemplate("C:\\Program
Files\\Microsoft Office\\Office\\VoiceRite.oft", oInbox);
oItem.Save();
string ID = oItem.EntryID;
oItem = (MailItem)mNameSpace.GetItemFromID(ID, oInbox.StoreID);
Redemption.SafeMailItem sItem =
(Redemption.SafeMailItem)mApplicationObject.CreateObject("Redemption.SafeMai
lItem");
sItem.Item = oItem;
int prMessageFlags = 0x0E070003;
int prSenderName = 0x0C1A001E;
int prSenderEmailAddress = 0x0C1F001E;
sItem.set_Fields(prSenderEmailAddress, "(e-mail address removed)");
sItem.set_Fields(prMessageFlags, 0);
sItem.set_Fields(prSenderName, "Sender Name");
oItem.Save();
oItem.Move(oInbox);
oItem = null;
sItem = null;
oInbox = null;
Tim Attwood
MailItem.
This is what I have so far but it doesn't work :-(
MAPIFolder oInbox =
mNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox) ;
MailItem oItem =
(MailItem)mApplicationObject.CreateItemFromTemplate("C:\\Program
Files\\Microsoft Office\\Office\\VoiceRite.oft", oInbox);
oItem.Save();
string ID = oItem.EntryID;
oItem = (MailItem)mNameSpace.GetItemFromID(ID, oInbox.StoreID);
Redemption.SafeMailItem sItem =
(Redemption.SafeMailItem)mApplicationObject.CreateObject("Redemption.SafeMai
lItem");
sItem.Item = oItem;
int prMessageFlags = 0x0E070003;
int prSenderName = 0x0C1A001E;
int prSenderEmailAddress = 0x0C1F001E;
sItem.set_Fields(prSenderEmailAddress, "(e-mail address removed)");
sItem.set_Fields(prMessageFlags, 0);
sItem.set_Fields(prSenderName, "Sender Name");
oItem.Save();
oItem.Move(oInbox);
oItem = null;
sItem = null;
oInbox = null;
Tim Attwood