Search code examples
vbams-accessoutlookoutlook-redemption

MS Access Redemption, safeMailItem.To not sticking?


I am trying to set the To field of a Redemption.SafeMailItem object called myRed.

The variant to_email has value test@test.com and i set:

myRed.To = to_email

I breakpoint on this line and can verify that to_email has a value, but then after this line finishes, myRed.To is still an empty string.

What causes this?


Solution

  • Keep in mind that Redemption only implements the getter for the To property since only reading is blocked (setting is not). When you set the To property, Redemption passes the call to the original Outlook object assigned to the Item property.

    When you read the To property, Redemption returns the PR_DISPLAY_TO property, which is only updated by the store provider based on the recipient table contents when the item is saved. Try to call MailItem.Save.