Automating an HTML Outlook email with AutoHotKey

Outlook email

HTML Outlook emailAutoHotkey Merchandise-White Stress ball

With AutoHotKey it is very easy to automate an HTML Outlook email!  In the script below I show how to populate some of the common parameters of the object and insert HTML to the body as well as passing in a variable with time.  You can easily tweak the settings to your needs.
 

 
#SingleInstance, Force 
Browser_Forward::Reload
Browser_Back:: ;hotkey for running below
olMailItem := 0
o:= ComObjActive("Outlook.Application").Session()
MailItem := ComObjActive("Outlook.Application").CreateItem(olMailItem)
MailItem.BodyFormat := 2 ; olFormatHTML
MailItem.TO :="[email protected];[email protected]"
;~ MailItem.CC :=""
;~ MailItem.Replyto :="[email protected]"
TodayDate := A_DDDD . ", " . A_MMM . " " . A_DD . ", " . A_YYYY ;storing pretty version of date
MailItem.Subject := "email on " TodayDate ;Subject line of email
;***********html body of Outlook email******************* 
MailItem.HTMLBody := "
<H2 style='BACKGROUND-COLOR: red'><br></H2>
<HTML>Your file is here on "(TodayDate)" <br><br>
     
<span style='color:black'>Please let me know if you have any questions.
<br><br><a href='mailto:[email protected]'>Joe Glines</a> 
<br>214.567.3623
</HTML>"
;****************************** 
;~ MailItem.Attachments.Add(NewFile)
;~ MailItem.Display ;Make email visible
;~ mailItem.Close(0) ;Creates draft version in default folder
MailItem.Send() ;Sends the email
Return

Two women smiling and looking at a computer screen together in a bright office, one pointing at the monitor.Here is a video walking through the usage of the above script.

Automate LinkedIn email introductions / mesages

LinkedIn email introductionsWriting a “thank you” email in LinkedIn can be time consuming. I wrote a short script toAutoHotkey Merchandise-White Stress ball automate the process of writing LinkedIn email introductions.

It can dynamically populate the: To, subject line and message body which will greatly increase the likelihood of someone opening and reading your email.  Suddenly you can speak to a ton more people and still look like a rockstar!

 

 

LinkedIn email introductions automated via web scraping with AutoHotkey

Bearded man in denim shirt and woman in white top reviewing papers and a laptop together at a desk with coffee

Linkedin Robot for Automating Social Media Marketing 2014 …

May 2, 2014 … DOWNLOAD LINK: http://www.mediafire.com/download/f8tsv814ec8xhxn.

Get text from a list box; use AutoHotKey to grab items from programs

Get text from a list boxSometimes I’d like to be able to, progromatically, extract values listed inside a program. Woman holding a green-and-white Schüttelbecher-style bottle outdoors, with a label reading Schüttelbecher on the front Wait, let me correct that to Unfortunately many programs I use do not allow the ability to get text from a list box.

One of AHKs great strengths is how well it “hooks” into Windows.  I wrote an AutoHotKey script which allows me to copy and paste a list of items selected in the window.  There are lots of options like retrieve all items, only those selected, obtain the count of either previously mentioned.  Once you have all the items you can send instructions back to the list box and specify which one you want selected (thus if you frequently go back and select the same items, it can automate the process.

 
loop {
  ControlGet, Sel_CT, List, Count Selected, SysListView321, A ;Gets count of items selected from last active window
  ToolTip % Sel_CT
sleep, 300
}
Browser_Forward::Reload
#IfWinActive ahk_class #32770 ;Only run below if in Specific window type
Browser_Back::
ControlGet, Selected_Items,List,Selected      ,SysListView321, A ;gets Selected Items in last active window
ControlGet, Selected_CT   ,List,Selected Count,SysListView321, A ;gets count of selected items in last active window
ControlGet, All_Items,List,      ,SysListView321, A ;gets list of all items in last active window
ControlGet, All_CT   ,List, Count,SysListView321, A ;gets count of all items in last active window
Clipboard:=Selected_Items
MsgBox % "Number of Items selected: " Selected_CT "`r`r" Selected_Items
MsgBox % "Number of Items selected: " All_CT "`r`r" All_Items
return
#IfWinActive

A black AutoHotkey branded water bottle on a desk beside a laptop, with a person reading a newspaper in the background

Get text from a list box

https://www.youtube.com/watch?v=boj5RVyN0bc