set sFolder = CreateObject("Redemption.MAPIFolder")
sFolder.Item = MAPIFolder
set Items = sFolder.HiddenItems
'search by subject
set HiddenMsg = Items.Item("My config message")
If (HiddenMsg is Nothing) Then
'we must create IPM.Note or any other standard class derived
'messages, otherwise Outlook will complain that it cannot
'find the default form :-(
set HiddenMsg = Items.Add("IPM.Note.MyProduct.Config")
'set the subject so we can find this message next time
HiddenMsg.Subject = "My config message"
End If
'just for the fun of it, store our custom data
'in a named prop. We can just as well use any fixed tag prop
' (e.g. &H6900001E) since we are the only ones using this message
'and there shouldn't be any conflicts
PT_STRING8 = &H001E
PR_MYSTRING_PROP =
HiddenMsg.GetIDsFromNames("{FFF40745-D92F-4C11-9E14-92701F001EB3}",
"TestProp") or PT_STRING8
PropValue = HiddenMsg.Fields(PR_MYSTRING_PROP)
MsgBox "Old Value: " & PropValue
HiddenMsg.Fields(PR_MYSTRING_PROP) = "New Value"
HiddenMsg.Save
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool