Play Sound with CommandButton

  • Thread starter Thread starter thomas.schoenfelder
  • Start date Start date
T

thomas.schoenfelder

How can I play a wav file when a CommandButton from the Control Toolbox
is clicked

I've tried this but didn't work because CommandButtons don't accept
action Settings

ActivePresentation.Slides("Slide1").Shapes("CommandButton1").ActionSettings(ppMouseClick).SoundEffect.ImportFromFile
"MyWave.wav"
 
Why are you using a control (command button) instead of a PPT object (many
available in the drawing tool bar)?



Austin Myers
MS PowerPoint MVP Team

PowerPoint Video and PowerPoint Sound Solutions www.pfcmedia.com
 
I'm using this Button click event to blank out textboxes and manipulate
other shapes.
All I want is to play a sound when the textboxes (drawing tool bar)
disappear.
so i thought it's easiest to just run a soundplay macro when the button
is clicked
 
I'm using this Button click event to blank out textboxes and manipulate
other shapes.
All I want is to play a sound when the textboxes (drawing tool bar)
disappear.
so i thought it's easiest to just run a soundplay macro when the button
is clicked

Draw a button or any other shape, rightclick it and choose Action Settings.
Assign it a Run Macro action setting and point it at your macro to blank out
text boxes and so on. At the bottom of the dialog box, click Play Sound and
choose a sound.

You may need to drop a few DoEvents() commands into your macro to give the
sound time to play.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top