Microsoft KB Archive/101363: Difference between revisions
(importing KB archive) |
m (Text replacement - """ to """) |
||
Line 16: | Line 16: | ||
== SUMMARY == | == SUMMARY == | ||
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 | 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. | NOTE: Before you run the macro, you must load the file XLMAPI.XLL. | ||
Line 24: | Line 24: | ||
<pre> A | <pre> A | ||
1 auto_email | 1 auto_email | ||
2 =MAIL.LOGON(, | 2 =MAIL.LOGON(,"CoolPass",FALSE) | ||
3 =MAIL.NEW.MESSAGE() | 3 =MAIL.NEW.MESSAGE() | ||
4 =SET.MAIL.MESSAGE(7, | 4 =SET.MAIL.MESSAGE(7,"JillDoe")) | ||
5 =SET.MAIL.MESSAGE(1, | 5 =SET.MAIL.MESSAGE(1,"My Test Message") | ||
6 =SET.MAIL.MESSAGE(8, | 6 =SET.MAIL.MESSAGE(8,"c:\windows\arches.bmp") | ||
7 =SET.MAIL.RECIPIENT(GET.MAIL.MESSAGE(9)+1, | 7 =SET.MAIL.RECIPIENT(GET.MAIL.MESSAGE(9)+1,"JoUser",,2) | ||
8 =MAIL.SEND.MESSAGE() | 8 =MAIL.SEND.MESSAGE() | ||
9 =MAIL.LOGOFF() | 9 =MAIL.LOGOFF() | ||
Line 38: | Line 38: | ||
* Line 3 creates a new, blank mail message. | * 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). | * 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 | * 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 9 sends the email message. | ||
* Line 11 disconnects mail for this instance of Microsoft Excel. | * Line 11 disconnects mail for this instance of Microsoft Excel. |
Latest revision as of 09:19, 20 July 2020
Excel: Using Workgroup Extensions for Microsoft ExcelLast reviewed: October 7, 1997 |
4.00 4.00a WINDOWS kbmacro The information in this article applies to:
SUMMARYThe 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 A 1 auto_email 2 =MAIL.LOGON(,"CoolPass",FALSE) 3 =MAIL.NEW.MESSAGE() 4 =SET.MAIL.MESSAGE(7,"JillDoe")) 5 =SET.MAIL.MESSAGE(1,"My Test Message") 6 =SET.MAIL.MESSAGE(8,"c:\windows\arches.bmp") 7 =SET.MAIL.RECIPIENT(GET.MAIL.MESSAGE(9)+1,"JoUser",,2) 8 =MAIL.SEND.MESSAGE() 9 =MAIL.LOGOFF() 10 =RETURN() where:
MORE INFORMATIONFor 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. REFERENCESWorkgroup Extensions for Microsoft Excel |
KBCategory: kbmacro Last reviewed: October 7, 1997 |