View Single Post
  #21   Report Post  
Stefan Blom
 
Posts: n/a
Default

Klaus, thank you for explaining!

--
Stefan Blom
Microsoft Word MVP


"Klaus Linke" wrote in message
...
Hi Stefan,

The macro only loops controls that are already on some (built-in or

custom)
toolbar.

To get all commands, you can make a loop where you add a control

with id 2,
3, 4, ... to some toolbar, get its caption and description text (and

other
stuff if you are interested) and delete it again.
I've got the idea from Howard Kaikow.
In most Word versions, that loop will crash at some point (the

earlier the
more properties you try to retrieve for the control), so it's a bit

messy.

Regards,
Klaus



"Stefan Blom" wrote:
"Klaus Linke" wrote:

You can add it using a macro:
CommandBars("Formatting").Controls.Add Id:=2792


This certainly works and it's easier than my suggestion. But how

did
you find the ID for the DistributePara command? I tried iterating

the
CommandBarControls collection:

Sub tryout()
Dim i As CommandBar, j As CommandBarControl
For Each i In CommandBars
For Each j In i.Controls
Debug.Print j.Caption, j.DescriptionText, j.ID
Next j
Next i
End Sub

... but I didn't see it there!

--
Stefan Blom
Microsoft Word MVP