Excel: Using the OPEN.MAIL Command in Macro

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("subject",FALSE)
   =IF(GET.DOCUMENT(1)="enclosure",ALERT("It opened"),ALERT("not there"))
   =RETURN()

where "subject" is a text string matching the subject of the mail message that is to be opened, and "enclosure" 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 "Microsoft Excel Functions and Macros" version 2.2 manual.


KBCategory: kbother
KBSubcategory:

Additional reference words: noupd


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: November 2, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.