E-mail notification of new task entry in public folders

Posted on 2008-10-17
Last Modified: 2009-02-01
We are using a task folder located in Public Folders. Four people have access to enter new tasks in this task folder. We would like to know if it is possible for an e-mail to be generated whenever a new task is entered into this task folder
Question by:mikcanavan
  • 3
  • 2
LVL 76

Expert Comment

by:David Lee
ID: 22742144
Hi, mikcanavan.

Yes, that's possible with a bit of scripting.  The script would have to be installed on the computer of each person that can enter a task.  I can provide the code if you want to go this route.
LVL 13

Expert Comment

ID: 22794696
Hi mikcanavan,
Or Right-click the PF
Tab Administration
Folder Assistant
Add Rule then Check Forward: fill-in To and select th method to be used or Rply-to with a template where To field is the target mailbox


Author Comment

ID: 22795090
Hi BlueDevilFan, Yes I would like to go down the script route. Thank you Stefri for you solution however I could not get this to work.
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

LVL 76

Accepted Solution

David Lee earned 500 total points
ID: 22799313
Here's the code.  Follow these instructions to use it.

1.  Start Outlook
2.  Click Tools->Macro->Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects and click on Module1
4.  Copy the code from the Code Snippet box and paste it into the right-hand pane of Outlook's VB Editor window
5.  Edit the code as needed.  I included comment lines wherever something needs to or can change
6.  Click the diskette icon on the toolbar to save the changes
7.  Close the VB Editor
8.  Close Outlook
9.  Start Outlook
10. Outlook will display a dialog-box warning that ThisOutlookSession contains macros and asking if you want to allow them to run.  Say yes.Start Outlook

Outlook has to be open and running on the computer this code is on for this to work.  If Outlook is not running, then neither is the code.
Public WithEvents olkFolder As Outlook.Items

Private Sub Application_Quit()

    Set olkFolder = Nothing

End Sub

Private Sub Application_Startup()

    'Change the path on the next line to that of your folder

    Set olkFolder = OpenOutlookFolder("Public Folders\All Public Folders\My Folder").Items

End Sub

Private Sub olkFolder_ItemAdd(ByVal Item As Object)

    Dim olkMsg As Outlook.MailItem

    Set olkMsg = Application.CreateItem(olMailItem)

    With olkMsg

        'Change the address, subject, and body on the following lines as needed

        .Recipients.Add ""


        .Subject = "New Item Added"

        .Body = "Something new was added."


    End With

    Set olkMsg = Nothing

End Sub

Function IsNothing(obj)

  If TypeName(obj) = "Nothing" Then

    IsNothing = True


    IsNothing = False

  End If

End Function


Function OpenOutlookFolder(strFolderPath As String) As Outlook.Folder

    Dim arrFolders As Variant, _

        varFolder As Variant, _

        olkFolder As Outlook.MAPIFolder

    On Error GoTo ehOpenOutlookFolder

    If strFolderPath = "" Then

        Set OpenOutlookFolder = Nothing


        If Left(strFolderPath, 1) = "\" Then

            strFolderPath = Right(strFolderPath, Len(strFolderPath) - 1)

        End If

        arrFolders = Split(strFolderPath, "\")

        For Each varFolder In arrFolders

            If IsNothing(olkFolder) Then

                Set olkFolder = Session.Folders(varFolder)


                Set olkFolder = olkFolder.Folders(varFolder)

            End If


        Set OpenOutlookFolder = olkFolder

    End If

    On Error GoTo 0

    Exit Function


    Set OpenOutlookFolder = Nothing

    On Error GoTo 0

End Function

Open in new window


Author Comment

ID: 23522815
Sorry for the delay.... This worked like a charm!
LVL 76

Expert Comment

by:David Lee
ID: 23522835
No problem.

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
Sometimes Outlook might have problems sending a message. There may be various causes- corrupted PST, AV scanner etc. The message, instead of going to the Sent Items folder, sits in the Outbox indefinitely. To remove it you can use a free tool cal…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now