Adding additional info to the MAPIFolder through redemption or CDO

  • Thread starter Thread starter Semut
  • Start date Start date
S

Semut

Hello, is there a way in Redemption or CDO to add in a customized field to
the MAPIFolder (not outlook items) so that I could write in some additional
information.


thank you.
 
Yes, just use Folder.Fields. Note that Exchange (unlike PST) folders do not
support named properties, so there is a chance your custom property will
collide with somebody's else props. You'd be better off using hidden
messages instead.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
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
 
thanks, you are of great help.

Dmitry Streblechenko (MVP) said:
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
 
Back
Top