Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

automatically move sent items

Status
Not open for further replies.

smolen45

IS-IT--Management
Jun 8, 2005
11
NL
hi,

does anyone know how to move sent items automatically from my own sent items folder to the 'manager' sent items folder, I tried a lot of rules in Outlook 2003 but couldn't find any that worked.

Grtz Piet
 
My OL version is 2k but it may be similar in OL03:

The Rules Wizard in 2k has options to place a copy of sent messages in a specified folder or move messages sent to a specified recipient.

You may be able to accomplish your task using multiple rules but it might be easier to use something like this procedure:

Code:
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''' Move messages from "Sent Items" folder to another folder
''' OL version: 2000
''' Folder access confirmation ("..Allow access for..")required!
'''
''' Create OL button:
'''
''' 1. View>Toolbars>Customize...>Toolbars>New
''' 2. Enter a name for toolbar
''' 3. Click "Commands" tab
''' 4. Select "Macros" in "Categories"
''' 5. Drag "Project1.ExportMail onto button
''' 6. Optional: Modify Selection
'''
''' OL2000: How to Assign a Macro to a Toolbar Button
''' [URL unfurl="true"]http://support.microsoft.com/default.aspx?scid=kb;en-us;252426[/URL]
'''''''''''''''''''''''''''''''''''''''''''''''
Sub MoveSentMail()
On Error GoTo Err_MoveSentMail

Dim molNamespace As Outlook.NameSpace, molMAPI As Outlook.MAPIFolder, _
    molDest As Outlook.MAPIFolder, molItem As Outlook.MailItem
Dim intCount As Integer

    Set molNamespace = Application.GetNamespace("MAPI")
    Set molMAPI = molNamespace.GetDefaultFolder(5) '(olFolderSentMail)  '' Source folder
    Set molDest = molNamespace.GetDefaultFolder(5).Folders("MgrSent")   '' Destination folder
    
        '' Optional count:
        intCount = molMAPI.Items.Count '' before
            Debug.Print molMAPI.Name, intCount
        
             For Each molItem In molMAPI.Items

                '' Specify criteria here:
                If molItem.To Like "*XYZ*" Or UCase(molItem.Subject) Like "*YZX*" Then
                    Debug.Print molItem.SentOn, molItem.Subject, molItem.To
                    molItem.Move molDest
                End If
                
            Next molItem

Exit_MoveSentMail:

    intCount = molMAPI.Items.Count '' after
    Debug.Print "Items left in folder: " & intCount    
    
    Set molNamespace = Nothing
    Set molMAPI = Nothing
    Set molDest = Nothing
    
    Exit Sub

Err_MoveSentMail:

    Debug.Print Err.Number, Err.Description
    Resume Next
    
End Sub

Modify to your needs.


TomCologne
 
Ok and how do I have to define the folder?

Set molMAPI = molNamespace.GetDefaultFolder(5) '(olFolderSentMail) '' Source Folder

Set molDest = molNamespace.GetDefaultFolder(5).Folders("MgrSent") '' Destination folder
 
You might also make an e-mail template same as a normal message, but where in the message options you have chosen your new destination mailbox in the delivery options.
No need for VB with this one !

Good luck

André
 
MgrSent" is of course only a sample name for the real folder, assuming it to be a subfolder of your "Sent Items".

I'm not sure if I understand André correctly but maybe you want to try his solution first.

TomCologne
 
Hi Tom,
just to be more precise, when you compose an e-mail with outlook you have a button named "options".
There you can change the folder where the sent messages are sent to suit your needs.
By default, this folder is the " Sent Items " folder.
So, using the outlook tools, you can design a form, exactly like the original e-mail ( or tailored to your needs), but change the options.
After you saved this "creation" ( using "Publish forms"), this template is available to you, and know the default folder for sent items is the one you chose.
Cheers
André
 
Thanks, André,

I get it now & you're right, probably no need vor code at all.

Have a nice day,


TomCologne

 
Hi,

this is possible, but in this way it is only possible to change it to a folder in your own store, and not to the mailbox store of your manager. I already found a new way, I just created a second outlook profile.

Many thanks,

Piet
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top