Question

Ok, So I'm constantly battling with Microsoft as I'm creating several templates for a few customers. My problem is this, simple textbox placeholders scattered all around a document allows me to press TAB to go to the next placeholder. Much like Tab order in Visual Studio. But for some strange reason, this doesn't work with rich textbox placeholders. And I need to use rich text for a few textboxes because the user should be allowed to alter the formatting of single characters. This is not possible with simple textboxes.

So I was thinking, could this be possible using macros? For example, if a textbox placeholder is selected and the macro is run, go to the next placeholder?

Was it helpful?

Solution

The Shape/TextBox objects can be accessed through

ThisDocument.Shapes.Item(index)

and checking the returned Shape object for

theShape.Type = msoTextBox

However, the Shape objects will be returned in the order that they were created, not their order on the page/document. To find the 'next' TextBox, you are probably going to have to loop through all TextBoxes and investigate their location (.Top, .Left etc) in order to find the correct one to move to with:

theNextShape.Select
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top