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
Solved

Outlook 2003 Question

Posted on 2006-11-08
4
187 Views
Last Modified: 2010-04-08
Hello Experts,

I have a user that wants to be able to transfer an email to a specific folder automatically after the email has been read. Is this possible?

Any comments would be appreciated.
0
Comment
Question by:Will Szymkowski
  • 2
4 Comments
 
LVL 97

Expert Comment

by:war1
ID: 17902654
Greetings, Spec01 !

You can create a rule to move email to a specific folder, then read the email from there. But there is nothing natively within Outlook that will move the email after you read it.

Best wishes!
0
 
LVL 76

Expert Comment

by:David Lee
ID: 17903309
Greetings, Spec01.

It might be possible with a bit of Outlook scripting.  Is that an option?

Cheers!
0
 
LVL 53

Author Comment

by:Will Szymkowski
ID: 17906824
Thanks for the fast responses. Unfortunitly I don't have mych back ground on scripting. Is it possible for someone to create a script or another way around this issue?

Any help is appreciated. I will also increase the point value to 500pts
0
 
LVL 76

Accepted Solution

by:
David Lee earned 250 total points
ID: 17929206
Spec01,

There doesn't seem to be a good solution for doing this.  I tried several possibilities and this one works the best.  It does have a flaw though.  If the user opens more than one message at a time, then it will only work for the last item opened.  Follow these instructions to use this.

1.  Start Outlook
2.  Click Tools->Macro->Visual Basic Editor.
3.  If not already expanded, expand Microsoft Office Outlook Objects and click on ThisOutlookSession.
4.  Copy the code and paste it into the right-hand pane of the VB Editor window.
5.  Edit the code as necessary.  I've placed comments where things need to change.
6.  Click the diskette icon on the toolbar to save the changes.
7.  Close the VB Editor.
8.  Click Tools->Macro->Security.
9.  Set the Security Level to Medium.
10.  Close Outlook.
11.  Start Outlook.
12.  Outlook will display a dialog-box warning that ThisOutlookSession contains macros and asking if you want to allow them to run.  Say yes.

I have not tested this thoroughly.  I tested enough to verify that it moves a read mail item when the message window is closed.

Dim WithEvents olkInspectors As Outlook.Inspectors, _
    WithEvents olkInspector As Outlook.Inspector, _
    objItem As Object

Private Sub Application_Startup()
    Set olkInspectors = Application.Inspectors
End Sub

Private Sub olkInspector_Close()
    If objItem.Class = olMail Then
        If objItem.UnRead = False Then
            'On the following line change the path of the Outlook folder that read items are to be moved to.
            objItem.Move OpenMAPIFolder("\Some Mailbox or Folder\Some Sub-folder")
        End If
    End If
End Sub

Private Sub olkInspectors_NewInspector(ByVal Inspector As Inspector)
    Set olkInspector = Application.ActiveInspector
    Set objItem = olkInspector.CurrentItem
End Sub

'Credit where credit is due.
'The code below is not mine.  I found it somewhere on the internet but do
'not remember where or who the author is.  The original author(s) deserves all
'the credit for these functions.
Function OpenMAPIFolder(szPath)
    Dim app, ns, flr, szDir, I
    Set flr = Nothing
    Set app = CreateObject("Outlook.Application")
    If Left(szPath, Len("\")) = "\" Then
        szPath = Mid(szPath, Len("\") + 1)
    Else
        Set flr = app.ActiveExplorer.CurrentFolder
    End If
    While szPath <> ""
        I = InStr(szPath, "\")
        If I Then
            szDir = Left(szPath, I - 1)
            szPath = Mid(szPath, I + Len("\"))
        Else
            szDir = szPath
            szPath = ""
        End If
        If IsNothing(flr) Then
            Set ns = app.GetNamespace("MAPI")
            Set flr = ns.Folders(szDir)
        Else
            Set flr = flr.Folders(szDir)
        End If
    Wend
    Set OpenMAPIFolder = flr
End Function

Function IsNothing(obj)
  If TypeName(obj) = "Nothing" Then
    IsNothing = True
  Else
    IsNothing = False
  End If
End Function
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
In this step by step procedure, you will come to know the details of creating an Outlook meeting in 2007, 2010, 2013 & 2016.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

860 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