R
reesd
I am having a problem with variables being set back to empty after a sub or
function completes. It seems to have recently come up in code that I thought
used to work so I am wondering if its some sort of Outlook setting (or
security hotfix) or if I am just missing something obvious.
If I place the following code in ThisOutlookSession and step though the Sub
I see that sentbox is properly set, but the moment I step out of the Sub it
goes back to Empty.
Any thoughts?
Thanks,
d
Option Explicit
Private WithEvents sentbox As Items
Public Sub TestSetup()
Dim objNS As NameSpace
Set objNS = Application.GetNamespace("MAPI")
Set sentbox = objNS.GetDefaultFolder(olFolderSentMail).Items
End Sub
function completes. It seems to have recently come up in code that I thought
used to work so I am wondering if its some sort of Outlook setting (or
security hotfix) or if I am just missing something obvious.
If I place the following code in ThisOutlookSession and step though the Sub
I see that sentbox is properly set, but the moment I step out of the Sub it
goes back to Empty.
Any thoughts?
Thanks,
d
Option Explicit
Private WithEvents sentbox As Items
Public Sub TestSetup()
Dim objNS As NameSpace
Set objNS = Application.GetNamespace("MAPI")
Set sentbox = objNS.GetDefaultFolder(olFolderSentMail).Items
End Sub