extract toolbar info

K

Keith G Hicks

I'm trying to find out where a previous programmer burried some things in
an mdb. The backend is MS SQL so I'm not concerned at all about tables (I
can get the tables from the sql scripter, and don't care about those right
now). I figured out a way to get the documenter to give me a text file that
I can search but the dang thing doesn't give me any info on toobars. And the
ExportXML method doesn't do that either. Many of the toolbar items call
functions with parameters and I need to be able to find out what's in those
parameters by searching a text file. Otherwise I'm stuck going over every
toolbar item one by one. Is there a way to get this info out of the mdb???
(not interested in spending money on FMS analyzer eitehr right now)

Thanks,

Keith
 
A

Albert D. Kallal

You can spend a few minutes writing some code to print out this information
(quite easy for any access developer).

Here something that I just air coded this up now...it is recursive, and
works quite well:

Sub t343()

Dim m As CommandBar
Dim c As CommandBarControl
For Each m In CommandBars

If m.BuiltIn = False Then
Debug.Print "for menuBar = " & m.Name
Call ShowMenuItem(m, 3)
Debug.Print "================="
Debug.Print " "
End If

Next

End Sub

Sub ShowMenuItem(m As CommandBar, intOff As Integer)

Dim c As CommandBarControl
Dim sc As String

On Error Resume Next
For Each c In m.Controls
If c.Type = 10 Then
Debug.Print String(intOff + 3, "-") & ">"; c.Caption
If c.BuiltIn = False Then
Call ShowMenuItem(c.CommandBar, intOff + 3)
Debug.Print ">"
End If
Else
sc = ""
sc = c.Caption
Debug.Print String(intOff, "-") & " " & sc & " action = " &
c.OnAction & " " & c.Parameter
End If
Next

End Sub


Just past the above into a code module and then place the cursor in t343 and
hit f5. You can then do a ctrl-a and a ctrl-c to copy the text out of the
debug window into notepad (text file).

I pasted in part of a sample menu system to show what hte aboe looks like
after my sig below:

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
(e-mail address removed)


for menuBar = frmGroups
------>File
------ &Close action =
------ &Save action =
------ Print Pre&view action =
------ S&end... action =------>&Edit
------ &Undo action =
------ Cu&t action =
------ &Copy action =
------ &Paste action =
------ Delete This Group action = =AskDeleteGroupMain()
------>&Reports
------>&Window
------>&Groups
------ Add a Group Tour action = =AskAddGroup()=================

for menuBar = frmHotels
------>&File
------ E&xit action =------>&Edit
------ &Undo action =
------ Cu&t action =
------ &Copy action =
------ &Paste action =
------ Delete Hotel action = =AskDeleteHotel()------>&Reports
------ Hotel phone list action = rptHotelList
------>&Window
=================


for menuBar = frmTourEditShort
--- Use This Tour action = =AskUseTour()
=================

for menuBar = frmTourSel
------>&File
------ E&xit action =
------>&Edit
------>&Reports
------ &Bus list for Guides/Hotels action = =AskPrintBus()
--------->People who &owe $
--------- View Report action = =askPrintBusOwe()
--------- Edit people who owe $ action = =AskViewOwe()------ Tour Sales action = =AskTourSales()------>&Window
------>&Tour
------ &View/Edit people in tour action = =askview()
------ &Groups - View/edit action = =AskEditGroups()
------ &Bus - print action = =AskPrintBus()
------ Mailing Labels - print action = =AskTourLabels()=================
 
J

John Spencer

You might find that you need to add a reference to the
Microsoft Office xx Object Library
to get the code to work

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top