The information in this article applies to:
SUMMARYThis article describes the correct way to use the Visual Basic for Applications MailLogon method in Microsoft Excel 97. It also lists possible problems that you may encounter when you use this method to establish a mail session in Microsoft Excel 97. MORE INFORMATIONMicrosoft provides examples of Visual Basic for Applications procedures for illustration only, without warranty either expressed or implied, including, but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. The Visual Basic procedures in this article are provided 'as is' and Microsoft does not guarantee that they can be used in all situations. While Microsoft support professionals can help explain the functionality of a particular macro, they will not modify these examples to provide added functionality, nor will they help you construct macros to meet your specific needs. If you have limited programming experience, you may want to consult one of the Microsoft Solution Providers. Solution Providers offer a wide range of fee-based services, including creating custom macros. For more information about Microsoft Solution Providers, call Microsoft Customer Information Service at (800) 426-9400. Using the MailLogon MethodTo properly use the MailLogon method, specify a valid Name argument. For example, if a mail profile called "John Q. Public" exists on your computer, the following line of code is valid:
Using the MailLogon Method ImproperlyIf you do not specify a Name argument in the MailLogon command, for example, if you use the following line of code
the Choose Profile dialog box may appear and request that you choose a mail
profile. This may be a problem if you want to run the macro without
supervision; if this is the case, specify a valid Name argument.
If the MailLogon command specifies an invalid Name argument, for example, if you use the following line of code
you may receive the following error message:
When you click OK, the Choose Profile dialog box is displayed. If you click Cancel in either the Choose Profile dialog box or the "Profile name is not valid" error message dialog box, you receive the following error message and the macro halts. Using the Password and DownloadNewMail ArgumentsThese arguments are optional; you only need to include them if your mail is protected by a password or if you want to download new mail messages immediately. Note that the Password argument is ignored if you are using Microsoft Exchange or Microsoft Outlook 97.Help Information for the MailLogon MethodThe Microsoft Excel Visual Basic Help topic for the MailLogon method states the following:Name Optional Variant. The mail account name of Microsoft Exchange profile name. If this argument is omitted, the default mail account name is used.This statement is not entirely correct. If you omit the Name argument from the MailLogon method, the Choose Profile dialog box may appear and request that you choose a mail profile. For an example of the correct way to use the MailLogon method, see the MailLogon Method example; the Name, Password, and DownloadNewMail arguments are all present and valid. Additional query words: XL97 mapi microsoft mail
Keywords : kberrmsg xlvbahowto xlvbainfo |
Last Reviewed: October 30, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |