G
gb0dms
I have coded my menus into my template
when I open the .dot all is fine
but when I open a .doc vs of this the menus do not show
I have this code, not as a module but in the Micorsoft WordObjects\This
Document
Public newControl As CommandBarControl
Public NewMenuBarEntry As CommandBarControl
Public MacrosMenu As CommandBars
Private Sub Document_Open()
Dim i As Long
For i = 1 To CommandBars("Menu Bar").Controls.Count
If i > CommandBars("Menu Bar").Controls.Count Then Exit For
With CommandBars("Menu Bar").Controls(i)
If .Caption Like "*DTP*" Then
.Delete
i = i - 1
End If
End With
Next
Set MacrosMenu = Application.CommandBars
Set NewMenuBarEntry = MacrosMenu("Menu Bar").Controls.Add
(Type:=msoControlPopup, Before:=9)
NewMenuBarEntry.Caption = "DT&P Macros"
' call subroutines to build each menu section
Menu_DataTables
Menu_InsertCharts
Menu_InsertGraphics
End Sub
Private Sub Document_Close()
Dim MacrosMenu As CommandBars
On Error Resume Next
Set MacrosMenu = Application.CommandBars
MacrosMenu("Menu Bar").Controls("DTP Macros").Delete
ActiveDocument.AttachedTemplate.Saved = True
End Sub
when I open the .dot all is fine
but when I open a .doc vs of this the menus do not show
I have this code, not as a module but in the Micorsoft WordObjects\This
Document
Public newControl As CommandBarControl
Public NewMenuBarEntry As CommandBarControl
Public MacrosMenu As CommandBars
Private Sub Document_Open()
Dim i As Long
For i = 1 To CommandBars("Menu Bar").Controls.Count
If i > CommandBars("Menu Bar").Controls.Count Then Exit For
With CommandBars("Menu Bar").Controls(i)
If .Caption Like "*DTP*" Then
.Delete
i = i - 1
End If
End With
Next
Set MacrosMenu = Application.CommandBars
Set NewMenuBarEntry = MacrosMenu("Menu Bar").Controls.Add
(Type:=msoControlPopup, Before:=9)
NewMenuBarEntry.Caption = "DT&P Macros"
' call subroutines to build each menu section
Menu_DataTables
Menu_InsertCharts
Menu_InsertGraphics
End Sub
Private Sub Document_Close()
Dim MacrosMenu As CommandBars
On Error Resume Next
Set MacrosMenu = Application.CommandBars
MacrosMenu("Menu Bar").Controls("DTP Macros").Delete
ActiveDocument.AttachedTemplate.Saved = True
End Sub