G
Greg Maxey
Hello,
Yesterday the Word Heretic (Steve Hudson) posted a macro for killing
footnotes. I have bumbled along for the last hour or so trying to adapt his
simple code to allow the user to input what he/wants to kill. I have tried
String, Range, Long, Object and several others where the ???? appears below
and I keep getting one error code or another about type mismatch, object not
set, and on and on.
Would one of you have a look and see if you can steer me back on course?
Thanks
Sub KillAnything()
Dim myThing As ?????
Title = "Kill Box"
Message = "Type the object name of the thing you want to kill e.g., Fields,
Shapes, etc."
myThing = InputBox(Message, Title)
'Even better would be a InputBox with radio buttons listing common objects
With ActiveDocument.myThing
While .Count > 0
.Item(1).Delete
Wend
End With
End Sub
Yesterday the Word Heretic (Steve Hudson) posted a macro for killing
footnotes. I have bumbled along for the last hour or so trying to adapt his
simple code to allow the user to input what he/wants to kill. I have tried
String, Range, Long, Object and several others where the ???? appears below
and I keep getting one error code or another about type mismatch, object not
set, and on and on.
Would one of you have a look and see if you can steer me back on course?
Thanks
Sub KillAnything()
Dim myThing As ?????
Title = "Kill Box"
Message = "Type the object name of the thing you want to kill e.g., Fields,
Shapes, etc."
myThing = InputBox(Message, Title)
'Even better would be a InputBox with radio buttons listing common objects
With ActiveDocument.myThing
While .Count > 0
.Item(1).Delete
Wend
End With
End Sub