Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''' 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