Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / January 2006

Tip: Looking for answers? Try searching our database.

New message in Public Folder

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Leech - 12 Jan 2006 13:40 GMT
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!
Ken Slovak - [MVP - Outlook] - 12 Jan 2006 15:14 GMT
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

Signature

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

> Hi there!
>
[quoted text clipped - 3 lines]
> messages arrived to Public Folder(s). what is the easiest way to solve the
> problem? need a little .wav file to be played. thanks!
Leech - 12 Jan 2006 16:11 GMT
Thank You, Ken.

I'm a beginner at VB therefore kindly ask You to help me with the first part
of the problem also. Any helpful internet link is appreciated (I'm still
looking for the code examples).
thanks in advance,

best regards

> 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.
[quoted text clipped - 30 lines]
> > messages arrived to Public Folder(s). what is the easiest way to solve the
> > problem? need a little .wav file to be played. thanks!
Ken Slovak - [MVP - Outlook] - 16 Jan 2006 16:36 GMT
Take a look at the code sample http://www.outlookcode.com/d/code/zaphtml.htm 
that shows how to use ItemAdd for the Items collection of the Inbox. You
would use code similar to that for the public folder.

Signature

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

> Thank You, Ken.
>
[quoted text clipped - 5 lines]
>
> best regards
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.