, 06 2015 . 16:40
+
!
, .
Access 2003.
2010. - Microsoft Office 15.0 Object Library
- 2007. - Microsoft Office 12.0 Object Library
. "Microsoft Office" ?!
. .
, , : 2003 , .
, , .
- .
.
Function Start()
Dim MyMenuBar As CommandBar
Dim Ctr_Pop As CommandBarPopup
Dim Ctr_Pop_but As CommandBarButton
'-------------
Set MyMenuBar = CommandBars.Add(Name:="MyMenu", Position:=msoBarTop, MenuBar:=True, Temporary:=True)
MyMenuBar.Visible = True
MyMenuBar.Protection = msoBarNoMove
'====================================================
Set Ctr_Pop_but = MyMenuBar.Controls.Add(msoControlButton)
With Ctr_Pop_but
.Style = msoButtonCaption
.Caption = "Kassets"
.TooltipText = "Help text"
.FaceId = 202
.OnAction = "=Fnd()"
.Parameter = "kass"
.BeginGroup = True
End With
'====================================================
End Function
Function Fnd()
Dim MyMenu As CommandBar, pr As String
'------------------------------------
Set MyMenu = CommandBars("MyMenu")
'------------------------------------
' The ActionControl property of command bars returns the control
' whose OnAction property is running this procedure.
pr = CommandBars.ActionControl.Parameter
Select Case pr
Case Is = "kass"
MsgBox "Clic on Menu"
End Select
End Function
http://www.sql.ru/forum/1155356/referens-ofisa-2007-vs-2010