How To Display a Closed Message (177624)



The information in this article applies to:

  • Microsoft Visual Basic for Applications 5.0
  • Microsoft Outlook 97 8.01
  • Microsoft Outlook 97 8.02
  • Microsoft Outlook 97 8.03

This article was previously published under Q177624

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
				

Modification Type:MinorLast Reviewed:6/30/2004
Keywords:kbhowto KB177624