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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top