|
-
Jun 26th, 2000, 01:25 AM
#1
Thread Starter
Junior Member
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]
-
Jun 26th, 2000, 05:38 AM
#2
Fanatic Member
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
www.RealisticGraphics.net
Running VS.Net Enterprise & VB 6
Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML
MSN Messenger: kmsheff
-
Jun 26th, 2000, 05:54 AM
#3
Frenzied Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|