I got "error '91': Object variable or With block variable not set" after running:
For Each obj In ActiveDocument.InlineShapes
If obj.OLEFormat.Object.Name = "Button" Then '<-error line
obj.Delete
End If
Next
I thought that I need to declare obj as InlineShape or as Object, but results were the same. I am sure that I have command button with name Button and I know diference between name and caption, neither works. This code is part of the code that runs after the same button is pressed.