Microsoft KB Archive/101363

From BetaArchive Wiki

Excel: Using Workgroup Extensions for Microsoft Excel

Last reviewed: October 7, 1997
Article ID: Q101363

4.00 4.00a WINDOWS kbmacro The information in this article applies to:

  • Microsoft Excel for Windows, versions 4.0 and 4.0a


The following macro demonstrates the steps necessary to send electronic mail from a Microsoft Excel macro using Workgroup Extensions for Microsoft Excel. The purpose of this macro is to send a mail message to a person with the email alias "JillDoe" and to attach the ARCHES.BMP file.

NOTE: Before you run the macro, you must load the file XLMAPI.XLL.

The macro is as follows

   1  auto_email
   2  =MAIL.LOGON(,"CoolPass",FALSE)
   4  =SET.MAIL.MESSAGE(7,"JillDoe"))
   5  =SET.MAIL.MESSAGE(1,"My Test Message")
   6  =SET.MAIL.MESSAGE(8,"c:\windows\arches.bmp")
   9  =MAIL.LOGOFF()
   10 =RETURN()


  • Line 2 of the macro connects to mail using the password CoolPass. Note here that you MUST use the MAIL.LOGON() command even if you are currently logged into mail. MAIL.LOGON() establishes a mail session for this instance of Microsoft Excel only.
  • Line 3 creates a new, blank mail message.
  • Lines 4-6 use the SET.MAIL.MESSAGE() command to fill in the header information for the mail message. In each line, the first argument specifies which part of the mail header you are modifying (7 is recipient; 1 is subject text; 8 is attachment path and filename).
  • Line 7 uses the GET.MAIL.RECIPIENT() command to add JoUser to the cc (carbon copy) line of the mail message. The GET.MAIL.MESSAGE() command is used to get the total number of recipients and adding 1 to it (which creates "room" for the person being added to the cc line).
  • Line 9 sends the email message.
  • Line 11 disconnects mail for this instance of Microsoft Excel.


For more information on Workgroup Extensions for Microsoft Excel, or to obtain the XLMAPI.XLL file, download the file MAPIDEMO.EXE from the Microsoft Download Service at (425) 936-MSDL.


Workgroup Extensions for Microsoft Excel

KBCategory: kbmacro


Additional reference words: 4.X 4.00 4.00a xl emailing electronic
Keywords : kbmacro
Version : 4.00 4.00a
Platform : WINDOWS

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