Microsoft KB Archive/209248

= WD2000: Macro to Send a Word Document as Text or an Attachment =

Article ID: 209248

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft Word 2000 Standard Edition

-



This article was previously published under Q209248





SUMMARY
The SendMail method in Microsoft Visual Basic for Applications opens a message window for sending the active document through a MAPI-compliant mail system, such as Microsoft Outlook or Microsoft Exchange.

This article describes how to programmatically set whether the document is inserted as text or as an embedded attachment in the mail message.



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.

For more information about how to use the sample code in this article, click the article number below to view the article in the Microsoft Knowledge Base:

212536 OFF2000: How to Run Sample Code from Knowledge Base Articles

The following sample Visual Basic for Applications macro shows how to change the SendMailAttach setting programmatically: Sub SetMailAttachOption

Application.Options.SendMailAttach = True  'Or False ActiveDocument.SendMail

End Sub For more information about sending mail from Word, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type sendmail method in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

