Sound ein/aus
07.12.2005 11:24:40
Eule
hier zuerst mal meine Code:
Sub Abd1_BeiKlick()
ActiveSheet.Shapes("abd1").Visible = False
WAVStart
Play_PPS "a_meier.pps"
'WAVStop
End Sub
'''''''''''''''''''''''''
Beschreibung:
beim Klick auf ein Shape startet WAVStart (eine Melodie)
ein Powerpoint PPS wird gestartet
Problem:
wird das pps abgebrochen oder beendet, sollte eigentlich WAVStop (dummyMelodie) ablaufen.
Tuts aber nicht, obiges Makro läuft durch, mit der Konsequenz, das WAVStop gleich gestartet wird und somit WAVStart überhaupt nicht zu hören, da abgebrochen.
Wer weiß Rat?!!
hier noch die anderen Makros
'''''''''''''''''''''''''''''
Option Explicit
Declare
Function sndPlaySound32 Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName _
As String, ByVal uFlags As Long) As Long
Sub WAVStart()
Call sndPlaySound32(ThisWorkbook.Path & "\dalli.wav", 1)
End Sub
Sub WAVStop()
Call sndPlaySound32(ThisWorkbook.Path & "\sndrec.wav", 1)
End Sub
''''''''''''''''''''''
Option Explicit
Private Declare
Function GetShortPathName Lib "kernel32.dll" Alias "GetShortPathNameA" ( _
ByVal lpszLongPath As String, _
ByVal lpszShortPath As String, _
ByVal cchBuffer As Long) As Long
Private Declare
Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Private Declare
Function GetActiveWindow Lib "user32.dll" () As Long
Private Const MAX_PATH = 260&
Private Const SW_MAXIMIZE = 3&
Public
Sub Play_PPS(strFile As String)
Dim strPath As String, strShortPath As String
strPath = ThisWorkbook.Path & "\"
strShortPath = Space(MAX_PATH)
GetShortPathName strPath & strFile, strShortPath, MAX_PATH
strShortPath = Left$(strShortPath, InStr(1, strShortPath, vbNullChar) - 1)
ShellExecute GetActiveWindow, "open", strShortPath, "", strPath, SW_MAXIMIZE
End Sub
''''''''''''''''''''''''''