Total Visual SourceBook

Total Visual SourceBook CD and Printed Manual

Microsoft Access/ Office 2016, 2013, 2010, and 2007 Version
is Shipping!

New features in Total Visual SourceBook for Access, Office 2007 and VB6

Supports Access/Office 2016, 2013, 2010 and 2007, and Visual Basic 6.0!

Separate version for Access/Office 2003, 2002, and 2000.

Separate version for:
Access 97/95


View all FMS products for Microsoft AccessAll Our Microsoft Access Products

SourceBook Info:

Why SourceBook?

 

"The code is exactly how I would like to write code and the algorithms used are very efficient and well-documented."

Van T. Dinh, Microsoft MVP

 

 

 

Microsoft Access, Office/VBA, VB6 Modules royalty-free source code libraryMicrosoft Access Modules royalty-free source code libraryMicrosoft Access VBA and VB6 Module Library Free trial of Total Visual SourceBook for Microsoft Access, Office, VB6 and VBA

Module: OfficeCommandBars in Category Microsoft Office : Automation from Total Visual SourceBook

Routines for working with command bars in Microsoft Office applications and files using VBA.

Procedure List

Procedure Name

Type

Description

(Declarations) Declarations Declarations and private variables for the modOfficeCommandBars module
CmdBarListToArray Procedure Fills the passed array with a list of all top level command bar names
CmdBarListControlsToArray Procedure Fills the passed array with the names of controls in the specified command bar
CmdBarListCallsToArray Procedure Fills the passed array with a list of all controls on the specified command bar and the action (macro or module) that they call
CmdBarAdd Procedure Add a command bar with this function, then use the CmdBarControlAdd code to add individual controls. In Office 2007, the Command Bars (menus and toolbars) are replaced by the Ribbon interface. Command bars show up as context menus in Office 2007.
CmdBarControlAdd Procedure Adds a control to a command bar
CmdBarCopy Procedure Copies the named command bar to a new name

Example Code for Using Module: OfficeCommandBars

' Example of modOfficeCommandBars
'
' To try this example, do the following:
' 1. Create a new form
' 2. Create a command button 'cmdTest'
' 3. Paste all the code from this example to the new form's module.

Private Sub cmdTest_Click()
  Dim astrNames() As String
  Dim intCount As Integer
  Dim intCounter As Integer
  Dim fOK As Boolean

  ' Get the list of all commmand bars
  intCount = CmdBarListToArray(astrNames)
  For intCounter = 0 To intCount - 1
    Debug.Print astrNames(intCounter)
  Next intCounter

  ' Copy a command bar
  fOK = CmdBarCopy("Form View", "newbar")
  Debug.Print "Command bar copied: " & fOK

  ' Get the list of command bar actions
  intCount = CmdBarListCallsToArray("newbar", astrNames)
  For intCounter = 0 To intCount - 1
    Debug.Print astrNames(intCounter)
  Next intCounter

  ' Find the list of controls in the command bar
  intCount = CmdBarListControlsToArray("newbar", True, astrNames)
  For intCounter = 0 To intCount - 1
    Debug.Print astrNames(intCounter)
  Next intCounter

End Sub

Microsoft Access Module LibraryOverview of Total Visual SourceBook

The source code in Total Visual SourceBook includes modules and classes for Microsoft Access, Visual Basic 6 (VB6), and Visual Basic for Applications (VBA) developers. Easily add this professionally written, tested, and documented royalty-free code into your applications to simplify your application development efforts.

Additional Resources