Remove Method (String)
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

ControlCollection.Remove Method (String)

Removes the specified control from the ControlCollection instance.

Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word (in

public void Remove (
	string name



The name of the control to be removed from the ControlCollection instance.

Controls that were added at design time cannot be removed from the ControlCollection instance. You can only use the Remove method to remove controls added at run time.

The following code example adds a Button control and a MonthCalendar control to the document, and then removes the Button control.

private void WordControlRemove()
    Microsoft.Office.Tools.Word.Controls.Button button1 =
        this.Controls.AddButton(0, 0, 56.25F, 17.25F,
         monthCalendar1 = this.Controls.AddMonthCalendar(
         0, 20, 75, 15, "monthCalendar1");

© 2015 Microsoft