Microsoft KB Archive/96982

{|
 * width="100%"|

WD: Macros to Send a Word Document as Text or an Attachment

 * }

Q96982

-

The information in this article applies to:


 * Microsoft Word for Windows, versions 2.0b, 2.0c, 6.0, 6.0a, 6.0c
 * Microsoft Word for Windows, versions 7.0, 7.0a
 * Microsoft Word for the Macintosh, versions 6.0, 6.0.1, 6.0.1a

-

SUMMARY
The WordBasic FileSendMail statement opens a message window for sending the active document through a Microsoft Messaging Application Programming Interface (MAPI) - compliant mail system, such as Microsoft Mail or Microsoft Exchange. The current document is either inserted as text or inserted as an embedded attachment to the mail message.

MORE INFORMATION
To change this setting programmatically, use the example appropriate for your version of Word.

WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code &quot;as is&quot; without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Word for Windows 6.x, 7.x
You can use the ToolsOptionsGeneral statement with the .SendMailAttach parameter to control whether the document is sent as text in the message window or as an attachment.

The following sample macro sends the current document as an attachment to a mail message:

  Sub MAIN ToolsOptionsGeneral .SendMailAttach = 1 FileSendMail End Sub The following sample macro inserts the current document text into a mail message:

  Sub MAIN ToolsOptionsGeneral .SendMailAttach = 0 FileSendMail End Sub

Word for Windows 2.x
The WordBasic FileSend statement is available in Word for Windows versions 2.0b and 2.0c. The .SendMailAttach argument was added to the ToolsOptionsGeneral command in Microsoft Word version 2.0c for Windows.

To obtain pre-sales information about new or updated Microsoft products, call the Microsoft Sales Information Center at (800) 426-9400. If you are outside the United States, contact the Microsoft subsidiary for your area. To locate your subsidiary, see the Microsoft World Wide Offices Web site at:

"http://www.microsoft.com/worldwide/default.htm"