PDF Programmer was telling us:
PDF Programmer nous racontait que :
> I've got the code for an Excel popup utility that adds a date entry
> option to the command bar. I'm trying to figure out how to convert
[quoted text clipped - 27 lines]
> Application.CommandBars("Cell").Controls("Insert Date").Delete
> End Sub
Here is something to get you going.
You may need to add code depending on what you want to happen to the button
you create after the document is closed..
'_______________________________________
Private Sub Document_Open()
Dim NewControl As CommandBarControl
CustomizationContext = ActiveDocument
'Assign shortcut to display calendar on SHIFT+CTRL+C
KeyBindings.Add KeyCategory:=wdKeyCategoryMacro, _
Command:="Module1.OpenCalendar", _
KeyCode:=BuildKeyCode(wdKeyShift, wdKeyControl, wdKeyC)
'Add item to shortcut menu on open
On Error Resume Next
Application.CommandBars("Header and Footer").Controls("Date").Delete
On Error GoTo 0
Set NewControl = Application.CommandBars("Header and
Footer").Controls.Add(msoControlButton)
With NewControl
.Caption = "Insert Date"
.OnAction = "Module1.OpenCalendar"
.BeginGroup = True
'One of those undocumented properties...
.Style = msoButtonCaption
End With
End Sub
'_______________________________________

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org