-
I'm trying to customize standard menus within Word that are on particular templates. I've read up and know how to apply the follwonig code to apply menu changes only to the active template, but I'm having diff getting my hands on the File, Edit and other standard menus.
word.application.CustomizationContext = ActiveDocument.AttachedTemplate
I've tried accessing the CommandBars collection.
I'd like to have a File menu with limited items on it. Some standard and some custom.
Please help soon.
Mark
[Edited by markhirt on 06-26-2000 at 02:27 PM]
-
Well, let's say you were going to add an item to the File menu. You would do something like this:
Code:
Dim RGOpen As CommandBarButton
Set RGOpen = Application.CommandBars("File").Controls.Add(Type:=msoControlButton, Before:=3)
With RGOpen
.Caption = CustomCaption
.OnAction = SubNameOfProcedure
End With
-
A general answer...
I don't know if this applies to your situation, but often times it is helpful to simply record a macro and then see what the code that the macro generated looks like. Just press record, do the actions that you want to perform programatically, then look at the code generated by the macro.
Of course the macro often adds a bunch of code that you can remove, but it can often answer questions that are otherwise difficult to solve.
I've done that with a few applications. Not sure if it would help you or not.