running outlook from whereever it is (32bit or 64)

Get help with using AutoHotkey and its commands and hotkeys
Posts: 7
Joined: 26 May 2018, 18:15

running outlook from whereever it is (32bit or 64)

26 Dec 2019, 09:29

I have been using AHK to send an email to a specific email set which should not change. It works perfectly on my machine but I want to share it with my coworkers. The trouble I am having is that the Outlook.exe is located in a different area in their computers. Is there a way to make it so I can use command line switches with this and still run outlook from wherever it is?

Here is the code I have, I have to change the file path each time but I am hoping with your help I can change that, thanks,

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
CoordMode, Mouse, Screen

if 0 != 1  ; The left side of a non-expression if-statement is always the name of a variable.
    MsgBox This script requires you to drop a file on it to activate.
GivenPath = %1%  ; Fetch the contents of the variable whose name is contained in A_Index.
    Loop %GivenPath%, 1
        LongPath = %A_LoopFileLongPath%
FACID := SubStr(LongPath, -12 , 9)
MouseGetPos, OutputVarX, OutputVarY
InputBox, refno, Reference Number, Please Enter the Reference Number from the CO,,200,150, OutputVarX, OutputVarY 
if ErrorLevel
;msgbox, %FACID%

Run %comspec% /C ""C:\Program Files (x86)\Microsoft Office\root\Office16\OUTLOOK.EXE"/c ipm.note /m "[email protected] &[email protected]`; [email protected] &subject=%FACID% - %refno% - Date Extension Only" /a "%LongPath%"",,Hide
WinWait, %FACID% - %refno% - Date Extension Only
WinActivate, %FACID% - %refno% - Date Extension Only
Send,{Enter} Please see the attached Date Extension Only CO for the above referenced site
User avatar
Posts: 1397
Joined: 19 Dec 2013, 11:16
Location: USA

Re: running outlook from whereever it is (32bit or 64)

26 Dec 2019, 10:42

Try removing the path C:\Program Files (x86)\Microsoft Office\root\Office16\, and only use Outlook.exe.

This works on my computer.
Image Bulldozer - Sokoban inspired game from 1994 recreated in AutoHotkey.
Posts: 7
Joined: 26 May 2018, 18:15

Re: running outlook from whereever it is (32bit or 64)

27 Dec 2019, 15:53

That doesn't work for me. I also tried C:\Outlook.exe and that didn't work either.

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], bjukrain, blenderfish, boiler, coder_chick, DaveT1, Google [Bot], hackkk745, RubbeH, TheDewd and 50 guests