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

Last reviewed: July 30, 1997
Article ID: 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 95, versions 7.0, 7.0a
  • 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 "as is" 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

REFERENCES

"Using WordBasic" by WexTech Systems and Microsoft

Kbcategory: kbusage kbmacro KBSubcategory:


Additional query words: winword2 2.0b 2.0c attachment winword
7.0 word95 word7 word6 icon embed mail sendmailattach file send macword
6.0.1 filesendmail
Version : 2.x 6.0 6.0a 6.0c 7.0 7.0a


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.