Microsoft KB Archive/170714

From BetaArchive Wiki
Knowledge Base


PRJ: Toolbar Button Not Upgraded If Assigned to SendKeys

Article ID: 170714

Article Last Modified on 1/20/2007



APPLIES TO

  • Microsoft Project 2000 Standard Edition
  • Microsoft Project 98 Standard Edition



This article was previously published under Q170714

SYMPTOMS

When you upgrade to Microsoft Project 98 or later, some of the toolbar buttons may not be upgraded correctly and will not be available.

CAUSE

This behavior occurs when you a button is assigned to the SendKeys command. This command is no longer available for buttons in Microsoft Project 98 or later.

WORKAROUND

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
To work around this problem, use the SendKeys command in a Visual Basic macro and assign this macro to a toolbar button. To do this, follow these steps:

  1. On the Tools menu, point to Macro, and then click Macros.
  2. In the Macro Name box, type SendKeys, and click Create.
  3. In the Visual Basic Editor, enter the following line of code:

          SendKeys "{Enter}"
                            

    The code window should look like this:

          Sub SendKeys()
             SendKeys "{Enter}"
          End Sub
                        
  4. On the File menu, click Save.
  5. On the File menu, click Close and Return to Microsoft Project.

After you create the macro, link it to a toolbar button, using these steps:

  1. On the Tools menu, point to Customize, and then click Toolbars.
  2. Click the Commands tab.
  3. In the Categories list, select All Commands. In the Commands list, drag the SendKeys macro to one of the toolbars.


NOTE: If you want to edit or change the button image, right-click the SendKeys button and click the appropriate command on the menu that appears.

  1. Click Close.


STATUS

Microsoft has confirmed this to be a problem in the versions of Microsoft Project listed above.


Additional query words: prj2000

Keywords: kbinterop kbprb kbsetup KB170714