Creating Custom Tags with Redemption

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
 
K

Ken Slovak - [MVP - Outlook]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top