Command Bars - too much space on right click menu

J

Joanne

Hello, I added the following code to create a new control in the "Text"
command bar . The control is there when I right click in the document but
there is a huge amount of space between this control and the one before it.
I'm not sure what's wrong here. Any help would be appreciated.

_____________________________________________
Private Sub Document_Open()
Dim NewControl As CommandBarControl
CustomizationContext = NormalTemplate
Set NewControl = ActiveDocument.CommandBars("Text").Controls.Add
NewControl.BeginGroup = True
NewControl.Caption = "Insert Date"
NewControl.OnAction = "TestCalendar"
End Sub
 
K

Klaus Linke

Hi Joanne,

Have you tried without the line "NewControl.BeginGroup = True"?

It should insert a line and some space before the new item. No idea why you see a lot of space, but not the line(?)...

Or maybe there is some control without a caption text from some former experiment? If you haven't customized the context menus, you might reset them and try again -- or check through the controls on the "Text" command bar and remove any junk you might find.

Regards,
Klaus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top