Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Warn me when there is a duplicate followup.That has a exact Subject match.

Posted on 2009-07-03
17
Medium Priority
?
207 Views
Last Modified: 2012-05-07
Hi,

Warn me when there is a duplicate followup.That has a exact Subject match.
I click the followup flag red as to do jobs as and when i get and read the email. There are times when i click the followup on similiar mails. So when there is a match with the subject of just the followup mails then popup a box with the subject and say it has a duplicate.

Regards
Sharath
0
Comment
Question by:bsharath
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 11
  • 5
17 Comments
 
LVL 28

Expert Comment

by:peakpeak
ID: 24805422
You might find some code to scratch from here:
http://www.outlookcode.com (download Sues code examples)
http://www.slovaktech.com/code_samples.htm
0
 
LVL 76

Expert Comment

by:David Lee
ID: 24835428
sharath,

I may be able to do this, but I don't think the result will be practical.  Especially if you want it to search more than a few folders for items with matching subjects.  Unfortunately Outlook doesn't trigger a unique event when an item is flagged.  The best you can do is watch for the item changing when the flag is applied.  That's a little cumbersome.  Then there's the problem of searching for a duplicate.  Outlook's advanced search requires specifying the folders to search.  Searching a few folders, a half-dozen or less, isn't a problem, but searching dozens of folders would be.  Then there's the speed of the search to consider.  Searching one folder with a few hundred items is pretty quick, but searching thousands of messages spread across multiple folders is going to produce a very noticeable lag.  I just don't think it's very practical.

peakpeak,

You post the same information to a lot of questions.  You might as well post "Go search Google for an answer."  It doesn't help the author of the question.  You should at least take the time to search those sites for code that's relevant to what the person is asking.  I know your moto is "Never reinvent the Wheel. Use Google." and I agree with you that authors could answer a lot of their own questions by doing a simple search.  The fact is that folks are paying money to get help with a question not to be told to go search for it themselves.  It'd be like you taking your car to a mechanic to diagnose a problem and the mechanic telling you to look in an auto manual because he knows the answer is there.  
0
 
LVL 11

Author Comment

by:bsharath
ID: 24836863
Hi David,

The only place i want to check for Duplicate Subjecdts when flagged is the Mailbox (Inbox)
I will have 1 flagged already and if i flag the 2nd one then popup a box.

I guess this would be easier...
As once i comple all the jobs only then i Move the mails to my psts and relevant folders
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 11

Author Comment

by:bsharath
ID: 24836864
Hi David,

The only place i want to check for Duplicate Subjecdts when flagged is the Mailbox (Inbox)
I will have 1 flagged already and if i flag the 2nd one then popup a box.

I guess this would be easier...
As once i comple all the jobs only then i Move the mails to my psts and relevant folders
0
 
LVL 11

Author Comment

by:bsharath
ID: 24962106
Hi David any views on this
0
 
LVL 11

Author Comment

by:bsharath
ID: 25005476
Hi David any views....
0
 
LVL 11

Author Comment

by:bsharath
ID: 25066207
Hi David...Any views on this please...
0
 
LVL 76

Accepted Solution

by:
David Lee earned 2000 total points
ID: 25110063
This should do it.  This code goes in the ThisOutlookSession module.
Dim WithEvents olkExplorers As Outlook.Explorers
Dim WithEvents olkExplorer As Outlook.Explorer
Dim WithEvents olkItem As Outlook.MailItem
Dim bolDuplicateItem As Boolean
 
Private Sub Application_Quit()
    Set olkExplorers = Nothing
    Set olkExplorer = Nothing
    Set olkItem = Nothing
End Sub
 
Private Sub Application_Startup()
    Set olkExplorers = Application.Explorers
    Set olkExplorer = Application.ActiveExplorer
End Sub
 
Private Sub olkExplorer_Activate()
    Set olkExplorer = Application.ActiveExplorer
End Sub
 
Private Sub olkExplorer_SelectionChange()
    Set olkItem = Application.ActiveExplorer.Selection(1)
End Sub
 
Private Sub olkExplorers_NewExplorer(ByVal Explorer As Explorer)
    Set olkExplorer = Explorer
End Sub
 
Private Sub olkItem_PropertyChange(ByVal Name As String)
    If Name = "FlagStatus" Then
        If olkItem.FlagStatus = olFlagMarked Then
            bolDuplicateItem = IsDuplicate()
        End If
    End If
End Sub
 
Private Sub olkItem_Write(Cancel As Boolean)
    If bolDuplicateItem Then
        If msgbox("You already have an item with this subject flagged for action." & vbCrLf & "Flag anyway?", vbQuestion + vbYesNo, "Check for Flagged Duplicates") = vbNo Then
            Cancel = True
        Else
            Cancel = False
        End If
    End If
    bolDuplicateItem = False
End Sub
 
Function IsDuplicate() As Boolean
    Dim olkItems As Outlook.Items, olkMessage As Outlook.MailItem
    Set olkItems = Session.GetDefaultFolder(olFolderInbox).Items.Restrict("[Subject] = '" & olkItem.Subject & "'")
    For Each olkMessage In olkItems
        If olkMessage.FlagStatus = olFlagMarked Then
            If olkMessage.EntryID <> olkItem.EntryID Then
                IsDuplicate = True
                Exit For
            End If
        End If
    Next
    Set olkItems = Nothing
    Set olkMessage = Nothing
End Function

Open in new window

0
 
LVL 11

Author Comment

by:bsharath
ID: 25111406
Thanks David...
Mailed you the code...I get a sub error... Can you help combine my code with this code please...
0
 
LVL 76

Expert Comment

by:David Lee
ID: 25119512
Done.
0
 
LVL 11

Author Comment

by:bsharath
ID: 25119839
David i did add the code you gave and when i select the Flag on 2 identical Subject mails i get no warning...
0
 
LVL 76

Expert Comment

by:David Lee
ID: 25121375
Are the messages in the Inbox?
0
 
LVL 11

Author Comment

by:bsharath
ID: 25121384
Yes both the messages are in the inbox
0
 
LVL 76

Expert Comment

by:David Lee
ID: 25121409
Did you close and restart Outlook after adding the code?
0
 
LVL 11

Author Comment

by:bsharath
ID: 25121421
Yes i did restart... Just going to try a log off
0
 
LVL 11

Author Comment

by:bsharath
ID: 25121599
Thanks a lot David Worked perfect after a restart... :-)
0
 
LVL 11

Author Comment

by:bsharath
ID: 25121852
Hi David,

When i click on the deleted folder. I get the attached error. Can you please suggest

Capture.JPG
0

Featured Post

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
In this article I discuss my selections of the Top Four free Outlook OST File Viewers available. Open, view and read even damaged OST files by using these tools. They all provide a clear preview of all data such as emails, notes, tasks, calendars, e…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

704 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