Z
zbud
How do refer to the commandbars in Acc 2003 using late binding.
I was using somethin like this but got the 429 error, using late
binding as not sure all users have the same version of Office.
Function AddMenuItem()
Dim myObj As Object
Dim myMenuBar As Object
Dim ctrl1 As Object
Set myObj = CreateObject("Office.Commandbar")
Set myMenuBar = myObj.CommandBars.ActiveMenuBar
Set newmenu = myMenuBar.Controls.Add(Type:=msoControlPopup,
Temporary:=True)
newmenu.Caption = "OLF-Custom"
Set ctrl1 = newmenu.Controls.Add(Type:=msoControlButton, ID:=1)
ctrl1.Caption = "Make PDF"
ctrl1.TooltipText = "Make PDF in c:\mydocuments"
ctrl1.Style = msoButtonCaption
ctrl1.OnAction = "Repor_to_PDF"
Set ctrl1 = Nothing
Set myMenuBar = Nothing
Set myObj = Nothing
End Function
Is there a way to get a list of all available references on a machine
via vba code?
Bud
I was using somethin like this but got the 429 error, using late
binding as not sure all users have the same version of Office.
Function AddMenuItem()
Dim myObj As Object
Dim myMenuBar As Object
Dim ctrl1 As Object
Set myObj = CreateObject("Office.Commandbar")
Set myMenuBar = myObj.CommandBars.ActiveMenuBar
Set newmenu = myMenuBar.Controls.Add(Type:=msoControlPopup,
Temporary:=True)
newmenu.Caption = "OLF-Custom"
Set ctrl1 = newmenu.Controls.Add(Type:=msoControlButton, ID:=1)
ctrl1.Caption = "Make PDF"
ctrl1.TooltipText = "Make PDF in c:\mydocuments"
ctrl1.Style = msoButtonCaption
ctrl1.OnAction = "Repor_to_PDF"
Set ctrl1 = Nothing
Set myMenuBar = Nothing
Set myObj = Nothing
End Function
Is there a way to get a list of all available references on a machine
via vba code?
Bud