HOWTO: Display a Closed Message

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 

Additional query words:

Keywords :
Version : WINDOWS:5.0,8.00,8.01,8.02,8.03
Platform : WINDOWS
Issue type : kbhowto


Last Reviewed: October 22, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.