Microsoft KB Archive/172958

= OL97: Command Line for Creating a Pre-Addressed E-mail Message =

Article ID: 172958

Article Last Modified on 1/20/2007

-

APPLIES TO


 * Microsoft Outlook 97 Standard Edition

-



This article was previously published under Q172958





SUMMARY
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:


 * Using a desktop shortcut.
 * Using the Microsoft Office Shortcut Bar.
 * Using the Shell command.



MORE INFORMATION
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 the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site:

https://partner.microsoft.com/global/30000104

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 Shortcut
To create a shortcut on your Windows desktop that automatically creates a new pre-addressed e-mail message, follow these steps:  Right-click a blank area of your Windows desktop, point to New, and then click Shortcut. In the Command Line box, type the following

"C:\Program Files\Microsoft Office\Office\Outlook.exe" /c ipm.note /m 

where  is the complete e-mail address of the recipient (For example, JohnDoe@msn.com.)

NOTE: You may have to modify the path if you did not install Outlook to the default setup location.

 Type a name for the shortcut, for example, Mail to John Doe. Click Finish.

NOTE: If you want to use a custom form in your desktop shortcut, use its message class rather than IPM.Note. For example, if the custom form you want to use has a display name of "MyForm," (without quotation marks) then the message class should be IPM.Note.MyForm, and the following is the command used to create a message using the custom form:

"C:\Program Files\Microsoft Office\Office\Outlook.exe" /c ipm.note.myform /m <full e-mail name>

How to Use the Microsoft Office Shortcut Bar
To add a button to the Office Shortcut Bar to automatically create a new pre-addressed e-mail message, follow these steps:
 * 1) Right-click your Office Shortcut Bar, and then click Customize.
 * 2) On the Buttons tab, click to select the Microsoft Outlook button, and then click OK. The Office Shortcut Bar should now contain an Outlook button.

How to Add the Command Line Switch to the Outlook Button
 Right-click the Outlook button on the Office Shortcut Bar, and then click Properties.</li> Click the Shortcut tab.</li> Click to position the insertion point at the end of the text in the Target box, type a space, and then type the following

/ c ipm.note /m <full e-mail name>

where <full e-mail name> is the complete e-mail address of the recipient (For example, JohnDoe@msn.com).

</li> Click OK.</li></ol>

The Outlook button on the Office Shortcut Bar starts Outlook if it is not already running, and creates a new e-mail message to JohnDoe@msn.com.

How to Use the Shell Command
To automatically create a new pre-addressed Outlook e-mail message by using the Shell command, follow these steps:  Start Microsoft Word.</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 Visual Basic for Applications editor

Shell "C:\Program Files\Microsoft Office\Office\Outlook.exe /c ipm.note /m <full e-mail name>"

where <full e-mail name> is the complete e-mail address of the recipient (For example, 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> In the Macro Name box, click to select SendMail, and then click Run. The SendMail macro creates a new e-mail message addressed to the recipient that you chose in step 4.</li></ol>

If Outlook is running, the e-mail message opens quickly. If Outlook is not running, there is a delay while the Windows Messaging System starts in the background.

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.

<div class="references_section">