HOWTO: Display a Closed Message

Last reviewed: December 11, 1997
Article ID: Q177624
The information in this article applies to:
  • Microsoft Visual Basic for Applications version 5.0
  • Microsoft Outlook, versions 8.00, 8.01, 8.02, 8.03

SUMMARY

Some applications may require hiding a currently-displayed message in order to display additional information. The following article describes how to close the message and redisplay it. The message used in the sample code below is created from a regular message (such as message class is IPM.Note), but the same logic should work for any message class.

MORE INFORMATION

The code below creates a message, hides (closes) it, and then redisplays it. It is from the Click event of a CommandButton named Command1.

NOTE: This code assumes that the project references include the "Microsoft Outlook 8.0 Object Library."

   Private Sub Command1_Click()
      Dim objOutApp As Outlook.Application
      Dim mail As Object
      Set objOutApp = CreateObject("Outlook.application")
      Set mail = objOutApp.CreateItem(0)
      mail.messageclass = "IPM.Note"
      mail.Save
      mail.Display
      mail.Close (0)
      objOutApp.ActiveExplorer.Currentfolder.Items("").display
   End Sub
Version           : WINDOWS:5.0,8.00,8.01,8.02,8.03
Platform          : WINDOWS
Issue type        : kbhowto


================================================================================


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: December 11, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.