Showing posts with label Adding Controls using Powerpoint VBA. Show all posts
Showing posts with label Adding Controls using Powerpoint VBA. Show all posts

Sunday, July 20, 2008

Creating Menu’s and CommandBars in Powerpoint using VBA

Add a powerpoint menu item using VBA

The following code helps in creating a menu in active menu bar.

Sub Add_New_Menu_ITem_Powerpoint()

Dim oMenuBar

Dim oMenu As CommandBarPopup

Dim oCtrl As CommandBarControl

oMenuBar = Application.CommandBars.ActiveMenuBar

oMenu = oMenuBar.Controls.Add(Type:=msoControlPopup, Temporary:=True)

oMenu.Caption = "VBADUD Menu"

oMenu.Enabled = True

oMenu.DescriptionText = "Sample Menu Created for VBADud Example"

oCtrl = oMenu.Controls.Add(Type:=msoControlButton)

oCtrl.Caption = "Set Font"

End Sub

oMenu As CommandBarPopup represents a pop-up control on a command bar. The use of CommandBars in some Microsoft Office applications has been superseded by the new Ribbon user interface.

Related Posts Plugin for WordPress, Blogger...
Download Windows Live Toolbar and personalize your Web experience! Add custom buttons to get the information you care about most.