QUOTE(OcalaHugh @ 19 Aug, 2008 - 03:47 AM)

The following code used to work. It still works for an old version I have of wmplayer.exe from windows98.
The code woul permit wmplayer to load and play the assigned WAV file.
Any Help would be appreciated.
vb
'------------------------------------
' PlaySound
'-------------------------------
'
'
If Winver = "None" Then
Exit Sub
End If
On Error GoTo err1:
Dim a, b1
'---------------------------
' Calculate the pause time
'---------------------------
'
'
'
b1 = SoundPath + SoundFile 'works
a = Shell(Winver + " " + b1, 0) ' works
'
'----------------------------
' Make a pause to play sound
'----------------------------
'
'
FindSize
Exit Sub
err1:
Err.Clear
End Sub
=====================
Notes:
Winver = "C;\Program Files\ Windows Media Player\wmplayer"
b1 = SoundPath + SoundFile
FindSize is used to determine a Pause time
Thank,
Hugh Haggerty
Mod Edit: Please use code tags when posting your code. Code tags are used like so =>

Thanks,
PsychoCoder

--------------- Here is a better solution ------------
The solution to making the Windows Media Player operate in a program is simple.
1. Go to Project Components
2. Check the Media box
3. Put the media icon on your form sheet
4, Put the following code in the Declaration section of a module to make it available to all forms
<code>
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long)
</code>
5. Put a command button on your form and copy the following code in to subroutine
<code>
Private Sub Command1_Click()
Dim s1
' s1 is the location of your WAV file
s1 = "c:\VectorSounds\numberline.wav"
'
' s1 is the path and name of the wav file
WindowsMediaPlayer1.URL = s1
'
</code>
6. If you do not want the mediam player visible, go to the attributes table and change it.
7. This will open the Windows Media Player is asynchronous mode . If you find out how to open the Windows Media Player is
synchronous mde, please drop me an email. h.a.haggerty@earthlink.net