Discussion Locked

Click to delete object from Word doc

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a Word object such as a command button in a Word document.
I want to have a procedure where a user clicks on the object and the object is removed from the Word document

3 replies

by kees.valkenswaard

Private Sub CommandButton1_Click()
Selection.ShapeRange.delete
End Sub
This would delete the control CommandButton1 if clicked. insert the line in the program code attached to the control.
Why delete a control by clicking it?
Perhaps some text is hidden behind it?

This discussion is closed to new replies.