0

I am getting a "File not found" error with trying to run Outlook in batch. Most likely due to an error in the way I am formatting the code. The script takes the contents of clipboard provided by 'getclip' as %1, zips it to clips.zip, uses && to pass to ipmnote which attaches it to a pre-loaded Outlook email

My original layout (which works) uses more lines of code and includes a mid-step of creating a file to be compressed. In trying to simplify the routine, I am getting errors saying Outlook cannot be found.

Outlook.exe is already in my System Path and I normally call it in using only the exe name. But I get the same "can't be located" error even when adding full path the file as shown here.

getclip>7z.exe a Clips.zip %1 -y && "C:\Program Files (x86)\Microsoft
Office\root\Office16\OUTLOOK.exe" /c ipm.note /m "email&subject=CLips.zip"
/a  Clips.zip
questorfla
  • 25
  • 6

1 Answers1

0

Thanks for the quick reply. But the problem was the attachment. The error shown is somewhat open to interpretation since it implies that the issue is that Outlook cannot be found. In fact, what it could not find was the "clips.zip" file needed to attach it. Once i added the path to find the attachment, it works perfectly.

Sometimes, it helps to write in and ask the question. By following testing the sequence for each step of the outlook command, i found the issue was only there when i added the attachment with the /a at the end. By giving the full path to find 'clips.zip', all errors are gone and the email is perfect.

The broken line in the code was created by posting the code using the "Code" button. I added characters as needed to force it to display properly I am sure there is a better way and I started to mention this but i figured most people would know that the proper path to Outlook especially being in quotes and all would not have a carriage return in the middle"

questorfla
  • 25
  • 6
  • The only thing i cant get it to do is automatically SEND once the email is done,. it would be nice to add an automatic "Send" to the ipm.note string but I don't see and switches for that :(, Guess i have to resort to VBS. – questorfla Sep 03 '16 at 18:35
  • To send the message you'll need to send a hotkey, probably Enter, into the message window. See [Press Keyboard keys using a batch file](http://stackoverflow.com/q/17038282). P.S. as for `most people would know` you might be surprised: there's a huge lot of questions here with even more obvious typos and errors. – wOxxOm Sep 03 '16 at 21:56