Question

Locked

Outlook 365 Macro

By Clay.Sanker ·
Tags: Windows, Software
I'm trying to create a macro in Outlook 365 that will attach specific docs to an open email(either new or a reply). I've found various macros that will do that but they all start a new emails as opposed to attaching to one I alreay have opened. I have the below script that I've tried to make work but it too creates a new email. All attachments are either PDF or Word format. I'm new to macros in Outlook and would appreciate any help you can give.

Sub ExistingMessageWithAttachment2()
Const olFormatHTML = 2
Dim objOutlook: Set objOutlook = CreateObject("Outlook.Application")
Dim olMailItem
Dim objMailItem: Set objMailItem = objOutlook.CreateItem(olMailItem)

objMailItem.To = strTO
objMailItem.CC = strCC
objMailItem.Subject = strSUBJECT
objMailItem.BodyFormat = olFormatHTML
objMailItem.HTMLBody = "<HTML><BODY>"

Set objOutlookAttach = objMailItem.Attachments.Add("P:\Telecom\Avaya\Manuals\9611 user guide.pdf")
Set objOutlookAttach = objMailItem.Attachments.Add("P:\Telecom\Avaya\Manuals\Avaya_IP_Imp_Guide.pdf")
objMailItem.Display
End Sub

This conversation is currently closed to new comments.

0 total posts (Page 1 of 1)  
Thread display: Collapse - | Expand +

All Answers

Share your knowledge
Back to Windows Forum
0 total posts (Page 1 of 1)  

Related Discussions

Related Forums