sspatriots
Well-known Member
- Joined
- Nov 22, 2011
- Messages
- 585
- Office Version
- 365
- Platform
- Windows
I have this macro that I found that used to open the Outlook App to a new e-mail. A generic version is below. However, it will not work on PC's with this "New Outlook" option switched on.
Any help would be much appreciated. I need something that works for both versions of Outlook. Thanks, SS
VBA Code:
Sub OpenNewOutlookMessage()
Dim outlookApp As Object
Dim newMail As Object
' Create an instance of Outlook
Set outlookApp = CreateObject("Outlook.Application")
' Create a new mail item
Set newMail = outlookApp.CreateItem(0) ' 0 represents a new mail item
' Set properties for the mail item (e.g., subject, body, recipients)
newMail.Subject = "New Email Subject"
newMail.Body = "This is the body of the email."
newMail.To = "recipient@example.com"
' Display the new mail item
newMail.Display
End Sub
Any help would be much appreciated. I need something that works for both versions of Outlook. Thanks, SS