Disable menu bar items

G

Guest

In my current application i have a custom made menu bar. I want to
disable/enable menu bar items run-time based upon the privileges granted to
the current user. How do I edo this with VBA code?

Thanks for any assistance.

/Leif
 
S

Stefan Hoffmann

hi Leif,

Leif said:
In my current application i have a custom made menu bar. I want to
disable/enable menu bar items run-time based upon the privileges granted to
the current user. How do I edo this with VBA code?
You need to reference the Microsoft Office Library:

Public Function ReportCheckCommandBars() As Boolean

On Local Error Resume Next

Dim cb As Office.CommandBar

For Each cb In CommandBars
If cb.Name = "Print Preview" Then
cb.Visible = True
End If
Next cb

End Function


mfG
--> stefan <--
 

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