Macro to initiate a message in Outlook?
Macro to initiate a message in Outlook?
(OP)
I am fairly new to writing macros in Excel but am having good success, not just recording but also editing and managing them. I am hoping to include in one of my macros the function of starting a new outgoing message in Outlook (2003), pasting ctrl-v, then populating the To: field and finally sending the message.
If anyone has experience working with Office macros other than Excel I would really appreciate this.
Outlook does not have a record macros feature though it can handle macros that are written from scratch.
Thank you in advance!
If anyone has experience working with Office macros other than Excel I would really appreciate this.
Outlook does not have a record macros feature though it can handle macros that are written from scratch.
Thank you in advance!





RE: Macro to initiate a message in Outlook?
CODE
Dim olApp As Object
Dim objNewMail As Object
Dim MyDataObj As New DataObject 'set reference to microsoft forms 2.0 object lib
Set olApp = CreateObject("Outlook.Application")
Set objNewMail = olApp.CreateItem(0)
MyDataObj.GetFromClipboard
'objNewMail.Subject = "Mail Subject"
'objNewMail.To = "Receipient@xxx.com"
'objNewMail.Body = MyDataObj.GetText() 'This will paste clipboard comments into body
objNewMail.display
End Sub