powerpoint - How to add a Add ins menu tab to Power Point 2007? -
i working power point 2007 there no add ins menu tab , can not find how add it.
when ppt 2007 , onward runs code creates "legacy" command bars or menu modifications, automatically adds add-ins tab ribbon , puts command bars/menu changes there. here's simple example code. can run is, or save add-in. once add-in loaded, auto_open code run every time ppt starts up.
sub auto_open() dim otoolbar commandbar dim obutton commandbarbutton dim mytoolbar string ' give toolbar name mytoolbar = "kewl tools" on error resume next ' doesn't stop on next line if toolbar's there ' create toolbar; powerpoint error if exists set otoolbar = commandbars.add(name:=mytoolbar, _ position:=msobarfloating, temporary:=true) if err.number <> 0 ' toolbar's there, have nothing exit sub end if on error goto errorhandler ' add button new toolbar set obutton = otoolbar.controls.add(type:=msocontrolbutton) ' , set of button's properties obutton .descriptiontext = "this first button" 'tooltip text when mouse if placed on button .caption = "do button1 stuff" 'text if text in icon chosen .onaction = "button1" 'runs sub button1() code when clicked .style = msobuttonicon ' button displays icon, not text or both .faceid = 52 ' chooses icon #52 available office icons end ' repeat above many more buttons need add ' sure change .onaction property @ least each new button ' can set toolbar position , visibility here if ' default, it'll visible when created. position ignored in ppt 2007 , later otoolbar.top = 150 otoolbar.left = 150 otoolbar.visible = true normalexit: exit sub ' doesn't go on run errorhandler code errorhandler: 'just in case there error msgbox err.number & vbcrlf & err.description resume normalexit: end sub sub button1() ' code run when click button 1 added above ' add similar subroutine each additional button create on toolbar ' silly example code. ' you'd put real working code here whatever ' want msgbox "stop poking pig!" end sub
Comments
Post a Comment