Microsoft KB Archive/61401

{| = Excel: Using the OPEN.MAIL Command in Macro =
 * width="100%"|

Last reviewed: November 2, 1994

Article ID: Q61401

SUMMARY
In Microsoft Excel, when using the OPEN.MAIL command in a macro, an error message is returned if a message with the specified subject is not found.

To disable this error message and see if the message was opened, the following sequence of macro commands can be used

=ERROR(FALSE) =OPEN.MAIL(&quot;subject&quot;,FALSE) =IF(GET.DOCUMENT(1)=&quot;enclosure&quot;,ALERT(&quot;It opened&quot;),ALERT(&quot;not there&quot;)) =RETURN where &quot;subject&quot; is a text string matching the subject of the mail message that is to be opened, and &quot;enclosure&quot; is a text string that matches the name of the file enclosed in the opened mail message. For more information on the OPEN.MAIL command, see page 255 of the &quot;Microsoft Excel Functions and Macros&quot; version 2.2 manual.
 * }