This documentation is archived and is not being maintained.

Remove Method [Variation 1] (General Extensibility)

Visual Studio .NET 2003
  • For the AddIn object, removes the Add-in from the collection of Add-ins and makes it unavailable.
  • For the ContextAttribute object, removes the attribute from its parent collection.
  • For the ProjectItem object, removes the project item from the collection.
Note   This method is not supported for Visual Basic .NET.
[Visual Basic .NET]
Public Sub Remove() 
[Visual Basic 6]
Sub Remove() 
HRESULT __stdcall Remove();
void Remove();
[JScript .NET]
public function Remove()


For the AddIn object, removes an Add-in from the list of Add-ins in the Add-In Manager dialog box. Remove applies only to Add-ins that load with the solution. The Remove method fails on items in the collection associated with the DTE object.

For the ProjectItem object, removes a project item from the project. If ProjectItem.ProjectItems is not Nullthat is, if there's a subdirectorythen Remove removes all of the project items in that directory and its subdirectories.


Sub RemoveExample()
   ' Set object references.
   Dim addincoll As AddIns
   Dim addinobj As AddIn
   Dim abc As AddIn
   ' Register an Add-in.
   addincoll = AddIns
   Shell("regsvr32 F:\AddIns\RegExplore\Debug\regexplore.dll")
   addinobj = addincoll.Item(1)

   ' Connect the Add-in if it's not already connected.
   If addinobj.Connected = False Then
      addinobj.Connected = True
   End If

   ' Add an Add-in to the Add-In Manager dialog, then remove it.
   abc = Solution().AddIns.Add(addinobj.ProgID, addinobj.Description, addinobj.Name, False)
End Sub

See Also

Applies To: AddIn Object | ContextAttribute Object | ProjectItem Object | Reference Object | VCFile Object | VCFilter Object