Skip to content

AddCloseButton Method

Description

Adds a close button to the message bar.

Syntax

Public Sub AddCloseButton( _
    ByVal ToolTip As String _
)

Parameters

  • ToolTip: Text displayed as a tooltip when the mouse is placed over the close button.

Remarks

Clicking on the close button will set Visible equal to False. Set Visible to True to display the Message Bar again.

Close Button

Example

Dim MessageBar As MessageBar  

Set MessageBar = CommandBars.MessageBar  

MessageBar.Visible = True  

MessageBar.AddCloseButton "Close Message Bar"  
MessageBar.AddButton ID_EDIT_COPY, "Options...", "Show more options"  
MessageBar.Message = _  
    "" & _  
    "        " & _  
    "        Security Warning" & _  
    "        Certain content has been disabled." & _  
    ""

See Also


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.