commandbutton text/assigning sounds

B

Bishop

My first question: Can I underline just one letter in a word on a
commandbutton? So say I have the word "PG-13" and I just want the 3
underlined. Is this possible?

Second question: Can I assign a .wav (or similar soundbit) to a button so
that when the button is pushed or activated that sound will play?
 
J

Jacob Skaria

Try the below...

Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Sub Macro()
sndPlaySound "C:\1.wav", 1
End Sub

If this post helps click Yes
 
B

Bishop

I thought about that but that requires the use of the Alt key. I have a
userform with 15 or so commandbuttons and any 10 of those will have to be
selected, say. That means I'd have to press Alt each time I want to select a
button. I wanted to stick with the ability to just press a single key (like
the code you suggested yesterday) to make the userform more efficient.
 
J

Jacob Skaria

Hi Bishop

I remember. Then why dont you try Keycode itself. Check the 2nd reply to
your previous post.

If this post helps click Yes
 

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

Top