Hi, i am trying to figure out how to properly set properties PR_SUBJECT_PREFIX_W and PR_NORMALIZED_SUBJECT_W on a message in a newly created PST file.
Hi,
There is no such file, I’m trying to create an empty .PST file (first <span style=“color: rgb(51, 51, 51); font-family: “Courier New”; font-size: 13px; background-color: rgb(255, 255, 255);”>using (PersonalStorage storage…) and than add message with subject, subject prefix and normalized subject to it.
Hi,
string path = “\”;<o:p></o:p>
using (PersonalStorage storage = PersonalStorage.Create(path + @"storage.pst", FileFormatVersion.Unicode))
{
FolderInfo folder = storage.RootFolder.AddSubFolder("folder name", "IPF.Note");
using (MapiMessage message = new MapiMessage())
{
message.Properties.Add(MapiPropertyTag.PR_SUBJECT_PREFIX_W, new MapiProperty(MapiPropertyTag.PR_SUBJECT_PREFIX_W, Encoding.Unicode.GetBytes("FW: "))); // PR_SUBJECT_PREFIX_W - NOT ADDED
message.Properties.Add(MapiPropertyTag.PR_NORMALIZED_SUBJECT_W, new MapiProperty(MapiPropertyTag.PR_NORMALIZED_SUBJECT_W, Encoding.Unicode.GetBytes("Normalized subject"))); // PR_NORMALIZED_SUBJECT_W - NOT ADDED
message.Properties.Add(MapiPropertyTag.PR_SUBJECT_W, new MapiProperty(MapiPropertyTag.PR_SUBJECT_W, Encoding.Unicode.GetBytes("FW: Some subject"))); // PR_SUBJECT_W - OK
folder.AddMessage(message);
}
}
using (PersonalStorage storage = PersonalStorage.FromFile(path + @"storage.pst"))
{
foreach (MessageInfo message in storage.RootFolder.GetSubFolder("folder name").EnumerateMessages())
{
MapiProperty subject = message.Properties[0x0037001F];
Console.WriteLine(subject == null ? "PR_SUBJECT_W not set" : "PR_SUBJECT_W: " + subject.GetString());
MapiProperty subjectPrefix = message.Properties[0x003D001F];
Console.WriteLine(subjectPrefix == null ? "PR_SUBJECT_PREFIX_W not set" : "PR_SUBJECT_PREFIX_W: " + subjectPrefix.GetString());
MapiProperty normalizedSubject = message.Properties[0x0E1D001F];
Console.WriteLine(normalizedSubject == null ? "PR_NORMALIZED_SUBJECT_W not set" : "PR_NORMALIZED_SUBJECT_W: " + normalizedSubject.GetString());
}
}
Hi,
- PidTagImportance 0x0017
- PidTagMessageClassW 0x001A
- PidTagSensitivity 0x0036
- PidTagSubjectW 0x0037
- PidTagClientSubmitTime 0x0039
- PidTagSentRepresentingNameW 0x0042
- PidTagMessageToMe 0x0057
- PidTagMessageCcMe 0x0058
- PidTagConversationTopicW 0x0070
- PidTagConversationIndex 0x0071
- PidTagDisplayCcW 0x0E03
- PidTagDisplayToW 0x0E04
- PidTagMessageDeliveryTime 0x0E06
- PidTagMessageFlags 0x0E07
- PidTagMessageSize 0x0E08
- PidTagMessageStatus 0x0E17
- PidTagReplItemid 0x0E30
- PidTagReplChangenum 0x0E33
- PidTagReplVersionHistory 0x0E34
- PidTagReplFlags 0x0E38
- PidTagReplCopiedfromVersionhistory 0x0E3C
- PidTagReplCopiedfromItemid 0x0E3D
- PidTagItemTemporaryFlags 0x1097
- PidTagLastModificationTime 0x3008
- PidTagSecureSubmitFlags 0x65C6
- PidTagLtpRowId 0x67F2
- PidTagLtpRowVer 0x67F3
- PidTagConversationId 0x3013