Har du set hvor smart det kan være?

Microsoft Office, Word skabeloner, Excel regnearkSmart Office Word skabelon system

SmartOffice - PlayMP3

Med disse koder kan du afspille en MP3 eller en WAV fil.



Eksempel 1

Public Sub PlayMyMP3(ByRef sSoundFile As String)
    ' Check placeringen af mplayer.exe på din pc
    Shell "C:\Windows\mplayer.exe /Play /Close " & sSoundFile, 6
End Sub
Eksempel 2

Private Declare Function PlaySound Lib "winmm.dll" _
  Alias "PlaySoundA" (ByVal lpszName As String, _
  ByVal hModule As Long, ByVal dwFlags As Long) As Long


Function Alarm(Cell, Condition)
    ' Play wav file
    Dim WAVFile As String
    Const SND_ASYNC = &H1
    Const SND_FILENAME = &H20000
    On Error GoTo ErrHandler
    If Evaluate(Cell.Value & Condition) Then
        WAVFile = ThisWorkbook.Path & "\sound.wav"
        Call PlaySound(WAVFile, 0&, SND_ASYNC Or SND_FILENAME)
        Alarm = True
        Exit Function
    End If
ErrHandler:
    Alarm = False
End Function


Test 1

Public Sub Test_PlayMyMP3()
    ' Angiv hvilken sang der skal afspilles
    PlayMyMP3 ("C:\Musik\Part_01_Of_My_Own_Song.mp3")
End Sub
   

Smart Office Freeware Smart Data Management
Compare 2 Columns
Excel Super- Subscript
Teachers Excel Tools
         
Smart Office - Word og Excel specialist