Export (0) Print
Expand All
ID
Top
Expand Minimize

Guid Property (General Extensibility)

Visual Studio .NET 2003

Returns the GUID for the given object.

[Visual Basic .NET]
Public ReadOnly Property Guid() As String
[Visual Basic 6]
Property Get Guid() As String
[C++]
HRESULT __stdcall get_Guid(
   /* [out, retval] */ BSTR* retVal
);
[C#]
string Guid {get;}
[JScript .NET]
public function get Guid() : String

Return Value

  • For the Addin object, returns the add-in's CLSID as obtained from the add-in's registry entry.
  • For the Command object, returns the command group GUID used to represent the command.
  • For the OutputWindowPane object, returns a string that uniquely identifies the Output windowpane.

Examples

Sub GuidExample()
   ' Set object references.
   Dim addincoll As AddIns
   Dim addinobj As AddIn       
   
   ' Register an add-in, check add-in count before and after the Update.
   addincoll = AddIns
   Shell("regsvr32 F:\AddIns\RegExplore\Debug\regexplore.dll")
   addincoll.Update()
   addinobj = addincoll.Item(1)
   MsgBox(addinobj.Guid)
End Sub

Sub GUIDExample()
  'Add a reference to the Office type library to gain access to the 
  'CommandBar object.
  Dim cmds As Commands
  Dim cmdobj As Command
  Dim customin, customout As Object
  Dim cmdbarobj As office.commandbar
        
  cmds = Commands
  cmdobj = cmds.Item("File.NewFile")
  msgbox(cmdobj.ID)
  msgbox(cmdobj.Guid)
  msgbox(cmdobj.IsAvailable)
  msgbox(cmdobj.Name)
  cmds.Raise(cmdobj.Guid, cmdobj.ID, customin, customout)
  cmdbarobj = cmds.AddCommandBar("Mycmdbar", vsCommandBarType.vsCommandBarTypeToolbar)
  msgbox(cmdbarobj.Name)
  cmdobj = cmds.AddNamedCommand(addins().Item(1), "mycommand", "mycommand", "tooltip for mycommand", True)
  msgbox(cmdobj.Name)
End Sub

See Also

OutputWindow Object | OutputWindowPane Object

Applies To: AddIn Object | Command Object | OutputWindowPane Object | ICoclassInfo Object | IControl Object | IInterfaceInfo Object | ITypeLibInfo Object

Show:
© 2014 Microsoft