Run -> Send via Outlook not working
Marek Šanoba last edited by
Hi, I have recently installed Notepad++ on a new PC and command “Send via Outlook” doesn’t work there. I have updated shortcuts.xml with:
<Command name="Send via Outlook" Ctrl="yes" Alt="yes" Shift="yes" Key="79">outlook /a "$(FULL_CURRENT_PATH)"</Command>
Notepad++ shows the command under Run tab, but it shows me this error when I try to Run it:
ShellExecute - ERROR The system cannot find the file specified. An attempt was made to execute the below command. -------------------------------------- Command: outlook Arguments: /a "c:\test.html" Error Code: 2 --------------------------------------
Notepad++ v8.4.4 (32-bit)
Build time : Jul 15 2022 - 17:56:38
Path : C:\Program Files (x86)\Notepad++\notepad++.exe
Command Line :
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 21H2
OS Build : 19044.1949
Current ANSI codepage : 1252
It’s strange that same command from shortcuts.xml works on my coworkers PC/Notepad++ but the same command doesn’t work for me. I’ve also installed different versions of Notepad++ but no lack there either :(
Could you please help?
Alan Kilborn last edited by
Supply complete path to Outlook?
Get it working via the Run menu’s Run dialog; if you just start hacking on shortcuts.xml it will probably take you longer to get it right.
PeterJones last edited by PeterJones
That said, you are allowed to have whatever commands you want in your run menu, so you are allowed to keep the ancient
outlook /a "$(FULL_CURRENT_PATH)"command if you want it. However, as with any program run from the command line, if it’s not in your PATH, you need to provide a full path to the outlook.exe executable. I have a working Outlook installation on my work laptop, but if I drop to cmd.exe or powershell and try to run Outlook from the command line by just typing
outlook.exe, I get the error
'outlook.exe' is not recognized as an internal or external command, operable program or batch file.. This is the equivalent command-line message to the ShellExecute ERROR that you quoted.
For my new work laptop, with a clean installation of Outlook, outlook.exe is not in the PATH, so neither the command line nor Notepad++'s Run command can find it. But if I set Notepad++ > Run > Run… to
"C:\Program Files (x86)\Microsoft Office\root\Office16\OUTLOOK.EXE" /a "$(FULL_CURRENT_FILE)", it will attach the saved copy of the active file to an email using outlook – please note the quote marks.
So you need to find your path to the outlook executable. (Probably something similar, though I’m guessing you have a sensible 64bit outlook at
"C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE", but that is just a guess)