Solved

Outlook 2003 Question

Posted on 2006-11-08
4
183 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Set OWA language and time zone in Exchange for individuals, all users or per database.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

757 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

21 Experts available now in Live!

Get 1:1 Help Now