Creating Custom Tags with Redemption

  • Thread starter Thread starter Kristy
  • Start date Start date
K

Kristy

Hi

I use HrSetOneProp/HrGetOneProp to store custom properties on some
MailItems. One of these is used to decide whether the item has to be
printed when added to another folder (usually a public folder).

Eg, if certain criteria is met then...

Set utils = CreateObject("Redemption.MAPIUtils")
PrCustomTag = utils.GetIDsFromNames(objItem.MAPIOBJECT,gsGUID,
"Print",True)
PrCustomTag = PrCustomTag + &H1E
utils.HrSetOneProp objItem.MAPIOBJECT, PrCustomTag, "Yes", True

Then when I use...
CustomField = utils.HrGetOneProp(objItem.MAPIOBJECT, PrCustomTag)
it will return "Yes" and I print the item.

I would also like to be able to change the same property to "No", so I
tried to overwrite it by using...

PrCustomTag = utils.GetIDsFromNames(objItem.MAPIOBJECT,gsGUID,
"Print",True)
PrCustomTag = PrCustomTag + &H1E
utils.HrSetOneProp objItem.MAPIOBJECT, PrCustomTag, "No", True

But it didn't work, it sill returned "Yes" :-(

What am I doing wrong?

Thanks

Kris
 
Are you looking at the property after your code runs using OutlookSpy to see
if the property was actually changed? Outlook caches items and if it isn't
aware of a change it won't show the change. Try doing something like
Item.Subject = Item.Subject then Item.Save to make Outlook think something
has changed and see if that helps. FWIW I usually use the Fields collection
of the item in Redemption to change values after I create a named property.
See if that works better for you also.
 
Back
Top