Export (0) Print
Expand All
Expand Minimize

IsAvailable Property

Visual Studio .NET 2003

Returns whether or not the command is currently enabled.

[Visual Basic .NET]
Public ReadOnly Property IsAvailable() As Boolean
[Visual Basic 6]
Property Get IsAvailable() As Boolean
HRESULT __stdcall get_IsAvailable(
   /* [out, retval] */ VARIANT_BOOL* retVal
public bool IsAvailable {get;}
[JScript .NET]
public function get IsAvailable() : Boolean

Return Value

Returns True if the command is currently enabled, False if otherwise.


Sub IsAvailableExample()
   ' Before running, you must add a reference to the Office 
   ' typelib to gain access to the CommandBar object.
   Dim cmds As Commands
   Dim cmdobj As Command
   Dim customin, customout As Object
   Dim colAddins As AddIns

   ' Set references.
   colAddins = DTE.AddIns()
   cmds = DTE.Commands
   cmdobj = cmds.Item("File.NewFile")

   ' List some of the command properties.
   MsgBox("Command Name: " & cmdobj.Name)
   MsgBox("Is Command Available?: " & cmdobj.IsAvailable)
   MsgBox("Command ID: " & cmdobj.ID)
   MsgBox("Command GUID: " & cmdobj.Guid)
End Sub

See Also

Applies To: Command Object

© 2014 Microsoft