18.3. Leaving The User in The Best Position to Continue Working

After your procedure finishes running, users need to be in the best possible position to continue their work. What exactly the best possible position entails depends on the situation, but here are three simple suggestions:

  • Usually, you'll want to leave users facing the same document they were working on when they started running the procedure. There are some obvious exceptions to this, such as when the procedure creates a new file for the user and the user is expecting to work in that file, but the general principle is sound.

  • If the file is essentially untouched (at least from the user's point of view), the Selection should probably be back where it was when the user started running the procedure. To restore the selection, you may want to define a range at the beginning of the procedure and then move the Selection back to it at the end of the procedure. In some applications, you could also use a bookmark or a named range — but if you do, be sure to remove it afterward.

  • If the procedure has created a new object in the file, and the user will be expecting to work with it, you may want to have that object selected at the end of the procedure.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.5.162