Project: Removing Button from Toolbar Not Recorded
  
PSS ID Number: Q113647
Article last modified on 04-06-1995
 
4.00    | 4.00
 
WINDOWS | MACINTOSH
 

--------------------------------------------------------------------
The information in this article applies to:
 
 - Microsoft Project for Windows, version 4.0
 - Microsoft Project for the Macintosh, version 4.0
--------------------------------------------------------------------
 
SYMPTOMS
========
 
In Microsoft Project, when you turn on the Macro Recorder, and then
you remove a button from a toolbar, nothing is recorded in the macro.
 
WORKAROUND
==========
 
To remove a button from a toolbar using a macro, you must edit the
macro and add the appropriate command instead of recording the macro.
The following example use the method and the ToolbarDeleteTool method
to remove a button from the toolbar.
 
   Sub Remove_Button
      ' Remove the second button from the Standard toolbar
      ' default second button is Open
      ToolbarDeleteTool toolbarname:="Standard", buttonindex:=2
   End Sub
 
Microsoft provides examples of Visual Basic procedures for
illustration only, without warranty either expressed or implied,
including but not limited to the implied warranties of
merchantability and/or fitness for a particular purpose. This Visual
Basic procedure is provided 'as is' and
Microsoft does not guarantee that it can be used in all situations.
Microsoft does not support modifications of this procedure to suit
customer requirements for a particular purpose. Note that a line that
is preceded by an apostrophe introduces a comment in the
code--comments are provided to explain what the code is doing at a
particular point in the procedure. Note also that an underscore
character (_) indicates that code continues from one line to the
next. You can type lines that contain this character as one logical
line or you can divide the lines of code and include the
line-continuation character.
 
STATUS
======
 
Microsoft has confirmed this to be a problem in the Microsoft
products listed at the beginning of this article. We are researching
this problem and will post new information here in the Microsoft
Knowledge Base as it becomes available.
 
MORE INFORMATION
================
 
Steps to Reproduce Behavior
---------------------------
 
1. In a new project, choose Record Macro from the Tools menu. In the Macro
   Name box, type "Remove_Button" and choose the Options button. Under
   Store Macro In, select the Current Project File option and choose OK.
 
2. Press the SHIFT key and drag the Print Preview button from the Standard
   toolbar to the project area.
 
4. From the Tools menu, choose Stop Recorder.
 
5. From the Tools menu, choose Macros. From the Macro Name list, select
   Remove_Button and choose Edit.
 
Nothing appears in the recorded macro.
 
REFERENCES
==========
 
For more information about the ToolbarDeleteTool method, choose the
Search button in Help and type:
 
   ToolbarDeleteTool
 
KBCategory: kbprg
KBSubcategory:
 
Additional reference words: 4.00
=============================================================================
Copyright Microsoft Corporation 1995.
