-
How do i get a handle on currently selected textbox?
Hello all,
I'm new to VBA in PowerPoint. I am finding it very confusing. How do I get a handle on the currently selected textbox?
I want to create a macro that will select all of the text in the textbox that has the focus and then open the 'Insert HyperLink' dialog.
Ideally, I would click on the text box, the 'select all' action would run, and the 'Insert HyperLink' dialog box would open.
Thanks
-
Hi,
This works in pp2003 when a textbox is selected
[vba] ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select
Application.CommandBars.FindControl(Id:=1576).Execute[/vba]
-
Thanks Andy
This works great.
However, I need to select the textbox then run the macro. Is there a way to reduce it to one step, maybe by getting the macro to run as soon as I select the textbox?
Thanks
-
I not sure you could do that.
What might work is to create a userform that lists all valid controls on slides and then run the code when the listbox choice changes.
The real problem I see though with this approach is anytime you select something the code would run but what if you select something by mistake?
Better to run the code on a postive action such as a button click.
-
You could add the code to a right click menu.
see pptalchemy.co.uk for details of how to do this
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules