This documentation is archived and is not being maintained.

Add Method (AddIns Collection)

Visual Studio .NET 2003

Adds an Add-in to the collection of Add-ins loaded when a particular solution loads, fails if the collection is the DTE.AddIns collection.

[Visual Basic .NET]
Public Function Add( _
   ProgID As String, _
   Description As String, _
   Name As String, _
   Connected As Boolean _
) As AddIn
[Visual Basic 6]
Function Add( _
   ProgID As String, _
   Description As String, _
   Name As String, _
   Connected As Boolean _
) As AddIn
[C++]
HRESULT __stdcall Add(
   BSTR ProgID,
   BSTR Description,
   BSTR Name,
   VARIANT_BOOL Connected,
   /* [out, retval] */ AddIn** retVal
);
[C#]
AddIn Add(
   string ProgID,
   string Description,
   string Name,
   bool Connected
);
[JScript .NET]
public function Add(
   ProgID : String,
   Description : String,
   Name : String,
   Connected : Boolean
) : AddIn

Parameters

ProgID
Required. The progID of the Add-in to add to the collection.
Description
Required. A description for the Add-in to add to the collection.
Name
Required. The name of the Add-in to add to the collection.
Connected
Required. Indicates whether the Add-in is currently loaded.

Return Value

Returns a AddIn object.

Example

Sub AddExample()
   ' For this example to work correctly, there should be an add-in 
   ' available in the Visual Studio .NET environment.
   ' Set object references.
   Dim addincoll As AddIns
   Dim addinobj As AddIn

   addincoll = DTE.AddIns
   addinobj = addincoll.Item(1)

   ' Activates a solution Add-in so that it is available.
   addinobj = DTE.Solution.AddIns.Add(addinobj.ProgID, addinobj.Description, addinobj.Name, False)
End Sub

See Also

Applies To: AddIns Collection

Show: