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?

RE: Self-deleting macro button? by JeanGuyMarcil

JeanGuyMarcil
Fri May 09 09:21:02 PDT 2008

"Bob W" wrote:

> 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