I'm attempting to add a Context Menu option to PowerPoint 2010 that only appears when text is selected. Unfortunately the WindowBeforeRightClick event does not seem to fire if the mouse is inside of a TextBox.
Is there a different event I need to be listening to or a better way to add that context menu?
Related
I have coded a VBA macro that notifies me whenever a new comment has been added to a document using a MsgBox.
I now require that no notification should be in the form of a MsgBox but are displayed in a task pane by clicking on the custom button(Comment Notifier) on the ribbon of word.
Can you suggest me way to do this?
First of all, you need to migrate your existing VBA solution to the add-in rails. There is no way to create a task pane from VBA. The Walkthrough: Create your first VSTO Add-in for Word article explains how to get started quickly. After adding all event handlers to the add-in you may add a task pane to the add-in project, see How to: Add a custom task pane to an application for more information.
Finally, the Walkthrough: Synchronize a custom task pane with a Ribbon button explains how to automate a task pane by clicking on the ribbon button, so you just need to replace the source code a bit and display a notification on the task pane instead.
I have a vsto add-in for PowerPoint (vb.net) which includes a User Control with several buttons.
After clicking any of those buttons, or the User Control itself, I can't immediately use 'Ctrl' keyboard shortcuts, like Ctrl+C. It seems that the button or the User Control gets the focus. If I click on the slide, 'Ctrl' keyboard shortcuts work again.
Is there a way that I can take the focus away from the Button / User Control, in my Button1.Click event handler, in order to be able to use Ctrl+C right away? Or a way in which I can place the focus on the PPT Presentation?
I have searched and tried a ton of different methods, with no success...
PS: One observation I have made is that if instead of a Button, I click a Panel within my User Control, I do not have this problem.
Another observation is that while I can't use 'Ctrl' shortcuts right after clicking the button, 'Alt' shortcuts continue working fine.
I am developing a application in VB.NET. The user interface contains a ribbon tab with a few ribbon buttons. On each ribbon button click event, the application will execute a process.
When a process being executed, I want to lock the click event of other ribbon buttons. It means, the user should not be able to pick the other ribbon buttons.
I do not find the lock property for ribbon buttons. To avoid the button getting grey, I do not want to disable the button. please provide your suggestion.
I've been writing a custom ribbon with VSTO (using VB.net and XML) and I have written a number of buttons who's labels & pressed states depend on the calculation mode that Excel is in.
The getPressed and getLabels callback functions check for the excel calculation mode but these are only called when the ribbon is first loaded or the buttons are clicked. If someone were to go into the "formulas" tab, change the calculation mode and then go back to the custom ribbon tab, the pressed states and labels on the buttons in this custom tab would now be incorrect.
Is there a way to trigger these callback functions to be called (eg a way to call the ribbon.invalidate() function) when someone clicks on the custom ribbon tab in Excel?
I'm looking to automate a simple process in VBA and need to "click" a ribbon button. It makes the most sense to just call the button's underlying method. Is there a way to figure out what it is?
We are using Excel 2007 and 2010.
If it's Excel 2003 or earlier, you can use the CommandbarControl.Execute method. For instance:
Application.Commandbars("3rd Party Toolbar").Controls("Button to Push").Execute
There are two ways you can do this.
Right click on the toolbar and select Customise. If you right click on the button there may be details somewhere of what Macro the button is associated with.
If you record a macro and click the button. Then you can look at the VBA workspace and view the code that is generated to run your macro (which is just clicking the button you want). This will show you what method the macro clicks.