View Single Post
  #2  
Old January 12th 06, 03:14 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default New message in Public Folder

Handle the ItemAdd event for the Items collection for whatever public folder
you want, then call the Win32 API sound routines to play the sound.

Here's what the Win32 API calls would look like:

Public Declare Function sndPlaySound Lib "WINMM.DLL" Alias _
"sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As _
Long) As Long

Public Const SND_SYNC = &H0
Public Const SND_ASYNC = &H1
Public Const SND_NODEFAULT = &H2
Public Const SND_LOOP = &H8
Public Const SND_NOSTOP = &H10

Public Sub PlaySound(SoundName As String) 'must be .WAV file
Dim wFlags As Integer
Dim X As Integer

On Error Resume Next

If SoundName "" Then
wFlags = SND_ASYNC Or SND_NODEFAULT
X = sndPlaySound(SoundName, wFlags)
End If
End Sub


--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Leech" wrote in message
...
Hi there!

there is special alert when new message arrives to Personal Inbox folder.
different actions can be obtained thru Rules Wizard but it doesnt work
with
messages arrived to Public Folder(s). what is the easiest way to solve the
problem? need a little .wav file to be played. thanks!


Ads