Article ID: 197782 - View products that this article applies to.
This article has been archived. It is offered "as is" and will no longer be updated.
This article describes how to use command line switches to create a new e-mail message that is pre-addressed (with the To field filled in automatically). You can do this in one of the following ways:
Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs.
If you have limited programming experience, you may want to contact a Microsoft Certified Partner or Microsoft Advisory Services. For more information, visit these Microsoft Web sites:
Microsoft Certified Partners - https://partner.microsoft.com/global/30000104
Microsoft Advisory Services - http://support.microsoft.com/gp/advisoryservice
For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS
How to Use a Desktop ShortcutThere are two methods to create a desktop shortcut for pre-addressed mail. Use the first method if you send the e-mail through the default mail program. Use the second method if Outlook is not your default e-mail program.
Method 2To create a shortcut on your Windows desktop that automatically creates a new pre-addressed e-mail message, if Outlook is not the default e-mail program, follow these steps:
"C:\Program Files\Microsoft Office\Office\Outlook.exe" /c ipm.note.myform /m <full e-mail name>
How to Use the Microsoft Office Shortcut BarTo add a button to the Office Shortcut Bar to automatically create a new pre-addressed e-mail message, follow these steps:
How to Add the Command Line Switch to the Outlook Button
How to Use the Shell CommandTo automatically create a new pre-addressed Outlook e-mail message by using the Shell command, follow these steps:
NOTE: Using the Shell command is very restrictive. You can better automate the contents of a new e-mail message with Visual Basic for Applications or VBScript.
Single Command-Line String for a Message with Subject and BodyNOTE: The procedures that are outlined in this section assume that the you are familiar with creating the type of objects listed in the implementation list.
In order to create a preformatted and pre-addressed e-mail message, it is necessary to build a command-line string with the following parameters:
mailto:<to email>?cc=<cc email>&bcc=<bccWhere the following variable definitions apply:
mail>&subject=<subject text>&body=<body text>
Note the position of the question mark (?) and ampersand (&) characters in the command-line syntax.
Variable Field Entry -------------------------------------------------------------- <to e-mail> e-mail address to appear in the To field <cc mail> e-mail address to appear in the CC field <bcc mail> e-mail address to appear in the BCC field <subject> text to appear in the Subject field <body text> text to appear in the Body of the message
In addition to the field designations, you must use ASCII hexadecimal equivalents as variables for punctuation characters. The following variables are used to represent commonly used characters:
Space ( ) %20The following is an example of a command-line for the Subject and Body text using these variables:
Comma (,) %2C
Question Mark (?) %3F
Period (.) %2E
Exclamation Point (!) %21
Colon (:) %3A
Semicolon (;) %3B
This command-line yields the following information:
Subject: Hello World!
Body : How are you, John?
Uses of the Command-Line StringThis command-line string may be used in the following implementations:
For more information about automating Outlook, please see the following articles in the Microsoft Knowledge Base:
201096For more information about Outlook command-line switches, please see the following article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/201096/EN-US/ ): OL2000: How to Automate Outlook from Another Program
(http://support.microsoft.com/kb/232309/EN-US/ ): OL2000: How to Set a Form's From Field Using VBScript
(http://support.microsoft.com/kb/146636/EN-US/ ): OL2000: Questions About Custom Forms and Outlook Solutions
197180For more information about controlling the starting of Outlook, click Microsoft Outlook Help on the Help menu, type "Control what happens when you start Outlook " in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
(http://support.microsoft.com/kb/197180/EN-US/ ): OL2000: Additional Command-Line Switches
(http://go.microsoft.com/fwlink/?LinkId=151500)for other considerations.
Contact us for more help