Hi,
I have the following code
Which in theory should work fine, however, I have found that as soon as I try to access the UserProperties collection on a message currrently sending, it errors with
So does this mean it is impossible for me to check if the email being sent is the email I am interested in as you cannot access any properties of an email currently transmitting?
Would the only way to try to evaluate this would be by checking the outbox, if I get that error code and the email cannot be found in the sent items, assume the email being sent is the one I am after?
Your input is appreciated.
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Dance Music Downloads
I have the following code
Code:
Set oItems = oApp.GetNamespace("MAPI").GetDefaultFolder(olOutbox).Items
' Get first item
Set oMsg = oItems.GetFirst
' Check if matches
bFound = (oMsg.UserProperties.Item("EmailRef").Value = sEmailRef)
' Loop rest of outbox items
Do While Not oMsg Is Nothing And Not bFound
' Get next item
Set oMsg = oItems.GetNext
' Check if matches
bFound = (oMsg.UserProperties.Item("EmailRef").Value = sEmailRef)
Loop
Which in theory should work fine, however, I have found that as soon as I try to access the UserProperties collection on a message currrently sending, it errors with
-2147221228 : Outlook has already begun transmitting this message.
So does this mean it is impossible for me to check if the email being sent is the email I am interested in as you cannot access any properties of an email currently transmitting?
Would the only way to try to evaluate this would be by checking the outbox, if I get that error code and the email cannot be found in the sent items, assume the email being sent is the one I am after?
Your input is appreciated.
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Dance Music Downloads