|
-
Mar 14th, 2006, 03:05 PM
#1
Thread Starter
New Member
How do I Find control IDs in Visual Basic for Applications for office 2003?
I'm working on deploying office 2003 and I need to restrict/hide several of the pull down menu options as well as tool bar buttons. I found I can do this in an office 2003 policy in gpedit however I need some control ID's according to:
Finding control IDs in Visual Basic for Applications
(snip)
"...To disable any other command in an Office 2003 application, you set the Custom | Disable command bar buttons and menu items policy and add the control ID for the command you want to disable...
Finding control IDs in Visual Basic for Applications
You can look up control IDs for any item on a menu or toolbar in Office 2003 applications by using Microsoft Visual Basic® for Applications (VBA). You can either look up a single control ID or use a macro to find a series of control IDs. Then you enter the control ID into the Group Policy snap-in to disable that menu command and toolbar button."
(/snip)
Sooo.. I went and tracked down a copy of VBA 6.4, got a copy sent to me by mail and I installed it hoping it would be fairly straight forward (as I am not a programmer and have no experience in visual basic). I was hoping VBA was a program I could run.. then from there open the office exe files on my pc in an effort to locate those control ID's.. Well it doesn't work that way so I tried something else. I then ran word2003, hit alt+f11 (which opens VB) and used the script from the above web page:
Sub EnumerateControls()
Dim icbc As Integer
Dim cbcs As CommandBarControls
Set cbcs = Application.CommandBars("Menu Bar").Controls("File").Controls
For icbc = 1 To cbcs.Count
MsgBox cbcs(icbc).Caption & " = " & cbcs(icbc).ID
Next icbc
End Sub
I pasted this into a new macro and clicked on run which didn't work..
I'm pretty much running out of ideas and wondering if I'm in over my head or if this is possible for me to do.. thus I'm here for advice.
Can anyone tell me what I would need to do with VBA so I can find office command ID's?
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
|