'Align textbox and shape in Word via VBA

Problem 1

In MS Word, the Align commands as pictured below, do not work on textboxes. I have a textbox and a shape and would like them centered together.

Align commands

Solution

I'd like to write a VBA sub that'd take care of this. It is however quite complicated to determine which two objects are selected, especially if they're on a canvas or only one of them is on a canvas. It seems easier to read their names off the Selection taskpane.

Problem 2

How to determine which objects are highlighted on the Selection pane? In the example below, I'd like VBA to know that "3-Point Star 10" and "3-Point Star 9" are selected.

Selection taskpane



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source