COMObjects for forwarding an email

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
feudatory
Posts: 1
Joined: 16 Sep 2017, 07:09

COMObjects for forwarding an email

14 Mar 2018, 14:03

I use COMObjects to create new emails in Outlook 2016 and to Get email attributes.

For example, this returns Date, Sender Email address and Subject from the selected item in Outlook.

Code: Select all

olMailItem := 0
MailItem := ComObjActive("Outlook.Application").ActiveExplorer().Selection[1]

ShowDate := MailItem.ReceivedTime
ShowSender := MailItem.SenderEmailAddress
ShowSubject := MailItem.Subject
	
MsgBox, %ShowDate% |  %ShowSender% | %ShowSubject%
Now I'm looking for a solution to forward the selected email. Essentially, I need the same window to open that you would get when clicking the "Forward" icon/button you see in the Outlook Ribbon. I know a CTRL + F will create a forwarding email but I need to do it with COMObject (or the like) to further automate the process for my users.

There is a MailItem.Forward method for VBA but I can't find how to do it with COMObjects.

Thanks in advance.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 330 guests