This content has been marked as final. Show 3 replies
Not only do you lack a subject line, but it looks as though there is no
To: field specified either. Does the documentation you found for the "
/a " switch not provide a switch for the to: and subject: fields?
The following link is Microsoft’s list of switches for Outlook 2007. According to this list the /m address switch should allow you to specify the To: field, however, I couldn’t get it to work with Office 2003 (the list says to use the /m switch you must also use the /c ipm.note switch but I couldn’t get it to work either way). I found an old article that made mention of a /mailto switch that accepted normal URL encoding for all of the header fields (including Subject: ) but I couldn’t get that to work either (and since it’s not on the 2007 list I’m guessing it might not be the best choice anyway). Fortunately in my case the recipient will always be changing so the only field I’d like to populate would be the subject line (Outlook’s config takes care of the From: field).
The /a switch has been around for a while, I’ve seen it mentioned in articles as old as 2001, we only need to support Office 2003 and later.
Got it working (but it needs serious testing)…
The /m switch works and supports all of the header fields but it conflicts with the /recycle switch which is on by default (at least on my system). I’ve added a line that strips all of the switches from the reg supplied cmd string and adds /c and /m. Apparently, any path strings after /m are recognized as attachments and the /a switch must be removed to function. It remains to be seen if stripping all of the switches is safe, on my system /recycle was the only switch on by default.
Note: all of the header fields are optional.