Self-deleting macro button?

B

Bob W

I have a macrobutton embedded in a line of hidden 'instruction' text.

The macrobutton works fine - But the hidden instruction line is no longer
needed as soon as the macro executes. What syntax can I add to the macro
button's macro, that will delete the entire hidden line, macro button and
all, as the macrobutton executes?
 
J

Jean-Guy Marcil

Bob W said:
I have a macrobutton embedded in a line of hidden 'instruction' text.

The macrobutton works fine - But the hidden instruction line is no longer
needed as soon as the macro executes. What syntax can I add to the macro
button's macro, that will delete the entire hidden line, macro button and
all, as the macrobutton executes?

Bookmark the hidden line and then add something like this at the end of the
macro:

ActiveDocument.Bookmarks("MyHiddenLine").Range.Delete
 
Top