gvm said:
Jean-Guy, there are not any of the objects you mention apparent in the
document. Maybe there is one there that was put there by accident and is not
apparent because it is not functional. Is there any way of selecting control
toolbox objects? TIA .... Greg
:
They could be hidden, off the page, or behind other objects...
Run the following code to spot each one:
Sub test()
Dim inShpActiveX As InlineShape
Dim shpActiveX As Shape
For Each shpActiveX In ActiveDocument.Shapes
If shpActiveX.Type = msoOLEControlObject Then
MsgBox shpActiveX.OLEFormat.Object.Name
shpActiveX.Select
ActiveDocument.ToggleFormsDesign
Exit Sub
End If
Next
For Each inShpActiveX In ActiveDocument.InlineShapes
If inShpActiveX.Type = wdInlineShapeOLEControlObject Then
MsgBox inShpActiveX.OLEFormat.Object.Name
inShpActiveX.Select
ActiveDocument.ToggleFormsDesign
Exit Sub
End If
Next
End Sub
Hit delete on the keyboard once you have spotted them.
Or, if you do not care to see where and what they are, run this instead:
Sub test()
Dim inShpActiveX As InlineShape
Dim shpActiveX As Shape
For Each shpActiveX In ActiveDocument.Shapes
If shpActiveX.Type = msoOLEControlObject Then
shpActiveX.Delete
End If
Next
For Each inShpActiveX In ActiveDocument.InlineShapes
If inShpActiveX.Type = wdInlineShapeOLEControlObject Then
inShpActiveX.Delete
End If
Next
End Sub
I must use two "For...Next" blocks because ActiveX controls, like almost any
object on the page, can be inline or floating, which are two totally
different critters...
If you still experience problems, look in the VBA editor for any userforms
associated with the document.
If you need help with the macros, see
http://word.mvps.org/faqs/macrosvba/CreateAMacro.htm