ContentControlBase.Delete Method

Deletes a dynamically created content control from the document and removes it from the ControlCollection in the document.

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

void Delete(
	bool deleteContent
)

Parameters

deleteContent
Type: System.Boolean
true to delete the contents of the control; false to leave the contents of the control in the document.

ExceptionCondition
CannotRemoveControlException

The content control was added to the document at design time.

This method should only be used to delete a content control that is created programmatically at run time. An exception is thrown if you call this method on a content control that is added to the document at design time.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft