Launch Outlook to compose a message with subject and attachment by Outlook’s command line switches

commandoutlook

The following Outlook's command works well with Outlook 2010:

outlook.exe /c ipm.note /m "&subject=abc" /a "c:\attach.txt"

But it does not work with Outlook 2007 and 2003. The strange are following commands work well with Outlook 2007 and 2003:

outlook.exe /c ipm.note /m "&subject=abc"
outlook.exe /c ipm.note /a "c:\attach.txt"

How do I use one command line switch to launch Outlook to compose message with both subject and attachment for Outlook 2010/2007/2003?

Best Answer

So far from what I've discovered with Outlook 2007 is that in order to achieve this you have to realize that /a implies /c IPM.note.

So using

outlook.exe /a "FileName" /m "addresses&cc=&subject=&body="

Works just fine (took me forever to figure this out cause everyone on the web appears to insist that you must use /c when doing /m but not taking into account that /a does this for you automatically.

Also, I've noticed that using %20 isn't exactly correct when needing to put spaces, instead %2 (%20 without the 0) is doing the trick there. Otherwise you'll end up with a bunch of 0's after all the spaces, very strange indeed.

Related Topic