Powerpoint attaching a VBA function on a button -


i have found how create button , want make when press it following function.

<-button->

sub addbutton()    dim cb commandbar     set cb = application.commandbars.add("additional_toolbar", msobartop, , true)     cb.controls.add(msocontrolbutton)       .caption = "click me"       .onaction = "macro_name"       .style = msobuttoncaption    end    cb.visible = true end sub 

<-action want perform->

sub copysizeandposition()      ' usage: select 2 shapes. size , position of     ' first shape selected copied second.      dim w double     dim h double     dim l double     dim t double      activewindow.selection.shaperange(1)         w = .width         h = .height     end     activewindow.selection.shaperange(2)         .width = w         .height = h     end  end sub 

do u know how that?

change:

.onaction = "macro_name"

to:

.onaction = "copysizeandposition"


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -