How do I add an event handler to an object in MS Access VBA?
I have
It won't compile because it appears AddHandler isn't VBA.
However, I seem unable to dimension the objFolder object 'WithEvents' ?
How do I add the event handler for the 'ItemAdd' event on the 'Sent Items' MAPI folder object objFolder?
Thanks,
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
Code:
Dim objFolder As Object
Set objFolder = oApp.GetNamespace("MAPI").GetDefaultFolder(olFolderSentItems)
AddHandler objFolder.ItemAdd
It won't compile because it appears AddHandler isn't VBA.
However, I seem unable to dimension the objFolder object 'WithEvents' ?
How do I add the event handler for the 'ItemAdd' event on the 'Sent Items' MAPI folder object objFolder?
Thanks,
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