More programming for Microsoft Office command bars (3)
Source: Internet
Author: User
Commandbardocumenter and Commandbarcontroldocumenter Sub routines
When developing a command bar solution, I often need to get the index, name, or title of a particular command bar or command bar control. I created the commandbardocumenter and Commandbarcontroldocumenter subroutines to record the public properties of all command bars and command bar controls in a given Office application.
To run these samples, copy the following code into the code module of the Microsoft Office XP application in Visual Basic Editor, and then run the following subroutine one or both. When prompted, save the result as a text file (. txt). This makes the results easier to load into applications, such as Microsoft Excel, for viewing and filtering.
Public Sub Commandbardocumenter ()
' Purpose: Information about all command bars in the current application
' Write to a text file.
' You must first set up a reference to the Microsoft script runtime
' (Scrrun.dll) to make this code run correctly.
' Note: This code applies only to Microsoft Office XP.
Dim objCommandBar as Office.CommandBar
Dim Strtype as String
Dim Strposition as String
Dim Objfilesavedialog as Office.filedialog
Dim objFSO as Scripting.FileSystemObject
Dim objTextStream as Scripting.TextStream
Const Save_button as Integer =-1
Set Objfilesavedialog = Application.filedialog (msoFileDialogSaveAs)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.