Any ideas about why this simple code would't run with Outlook 2007? I have gmail IMAP inmail, so I am seeking advice about other reasons for code not running.
There are no error messages. Nothing happens when I run it from the macro dialog box.
The code is taken from the Absolute Beginner's Guide to VBA which has proven helpful to me. It is supposed to add an address, subject and message body to an email when I press the New Mail button.
Dim mi As MailItem
Set mi = Application.CreateItem(olMailItem)
Dim ns As NameSpace
Dim msg As MailItem
'Set up the namespace
Set ns = ThisOutlookSession.Session
'Create the new MailItem
Set msg = Application.CreateItem(olMailItem)
'Specify the recipient, subject, and body
'and then send the message
'Adjust the following address!
.Subject = "Just Testing"
.Body = "This is only a test of Section 11.4"