Microsoft KB Archive/829973

= How to create a pre-addressed e-mail message in Outlook 2007 and in Outlook 2003 =

Article ID: 829973

Article Last Modified on 11/26/2007

-

APPLIES TO


 * Microsoft Office Outlook 2007
 * Microsoft Office Outlook 2003

-



INTRODUCTION
This article describes how to use a command-line switch to create a new e-mail message and to populate the To field automatically in Microsoft Office Outlook 2007 and in Microsoft Office Outlook 2003 by using one of the following two methods:
 * Using a desktop shortcut.
 * Using the shell command.



MORE INFORMATION
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers 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 requirements.

Using a desktop shortcut
To create a shortcut that automatically pre-addresses a new e-mail message, follow these steps:  Right-click a blank area in your Windows desktop, point to New, and then click Shortcut. In the command location box, type (with the quotation marks) one of the following commands:  In Outlook 2007

&quot;C:\Program Files\Microsoft Office\Office12\Outlook.exe&quot; /c ipm.note /m  In Outlook 2003

&quot;C:\Program Files\Microsoft Office\Office11\Outlook.exe&quot; /c ipm.note /m 

where  is the complete e-mail address of the recipient.

In this example, the command-line location would be as follows:

&quot;C:\Program Files\Microsoft Office\Office11\Outlook.exe&quot; /c ipm.note /m JohnDoe@msn.com

Note This example assumes that Outlook 2003 is installed in the default setup location. You may have to modify the path if you did not install Outlook 2003 in the default setup location. Type a name for the shortcut, for example, type Mail to John Doe . Click Finish.</li></ol>

Note If you want to use a custom form in your desktop shortcut, use the message class of the custom form instead of using the message class of IPM.Note. For example, if the custom form that you want to use has a display name of &quot;MyForm,&quot; (without quotation marks) the message class would be IPM.Note.MyForm. In this example, the command-line location would be as follows:

&quot;C:\Program Files\Microsoft Office\Office11\Outlook.exe&quot; /c ipm.note.myform /m JohnDoe@msn.com

Using the shell command
To automatically create a new pre-addressed Outlook 2007 or Outlook 2003 e-mail message by using the shell command, follow these steps.

In Outlook 2007 <ol> Start Microsoft Office Word 2007.</li> On the Developer tab, click Macro.</li> In the Macro name box, type SendMail, and then click Create.</li>  Type the following sample code in the code editor, where  is the complete e-mail address of the recipient. Shell &quot;C:\Program Files\Microsoft Office\Office12\Outlook.exe /c ipm.note /m full e-mail name&quot; In this example, type Shell &quot;C:\Program Files\Microsoft Office\Office11\Outlook.exe /c ipm.note /m JohnDoe@msn.com. </li> On the File menu, click Close and Return to Microsoft Word.</li> On the Developer menu, click Macro.</li> Click the SendMail macro, and then click Run. The SendMail macro creates a new e-mail message that is pre-addressed to the recipient that you typed in step 4.</li></ol>

In Outlook 2003 <ol> Start Microsoft Office Word 2003.</li> On the Tools menu, point to Macro, and then click Macros.</li> In the Macro name box, type SendMail, and then click Create.</li>  Type the following sample code in the code editor, where  is the complete e-mail address of the recipient. Shell &quot;C:\Program Files\Microsoft Office\Office11\Outlook.exe /c ipm.note /m full e-mail name&quot; In this example, type Shell &quot;C:\Program Files\Microsoft Office\Office11\Outlook.exe /c ipm.note /m JohnDoe@msn.com. </li> On the File menu, click Close and Return to Microsoft Word.</li> On the Tools menu, point to Macro, and then click Macros.</li> Click the SendMail macro, and then click Run. The SendMail macro creates a new e-mail message that is pre-addressed to the recipient that you typed in step 4.</li></ol>

If Outlook 2007 or Outlook 2003 is not running, you may experience a delay while the Microsoft Windows Messaging System starts.

Note The shell command is very restrictive. You may have more automation features if you use Microsoft Visual Basic for Applications (VBA) or Microsoft Visual Basic Scripting Edition (VBScript).

Because of Outlook 2003 security enhancements, you cannot use a command-line to automatically populate the subject or the body of e-mail messages.

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

823923 You cannot use the /select switch to start Outlook 2003

Additional query words: OL2003 OL207

Keywords: kbhowto kbinfo kbprogramming kbsecurity kbemail kbusage kbvba KB829973

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.