M
Mike
Hi - I'm new to VBA for Outlook - please excuse if you come across any
obvious blunders.
I'm using a userform to handle items in various ways according to the
choices provided with controls in the userform. I've got the mailitem
via set statement as below (where MyNS As NameSpace, myInbox As
MAPIFolder, theMsg As MailItem, MoveTo As MAPIFolder are globally
declared):
Private Sub UserForm_Initialize()
Set MyNS = GetNamespace("MAPI")
Set myInbox = MyNS.GetDefaultFolder(olFolderInbox)
Set theMsg = myInbox.Items.GetFirst
... onwards
end sub
What I want to do now is pass the mailitem as set in theMsg on to the
click event of a command button in the form.
How do I do that?
obvious blunders.
I'm using a userform to handle items in various ways according to the
choices provided with controls in the userform. I've got the mailitem
via set statement as below (where MyNS As NameSpace, myInbox As
MAPIFolder, theMsg As MailItem, MoveTo As MAPIFolder are globally
declared):
Private Sub UserForm_Initialize()
Set MyNS = GetNamespace("MAPI")
Set myInbox = MyNS.GetDefaultFolder(olFolderInbox)
Set theMsg = myInbox.Items.GetFirst
... onwards
end sub
What I want to do now is pass the mailitem as set in theMsg on to the
click event of a command button in the form.
How do I do that?