Outlook: archive it!
I'm a huge fan of gmail. Although it takes some getting used to, I'm sure everyone who uses gmail loves it after some time, and would have a hard time going back to other clients. My problem is that I must use MS Outlook at work...it's inescapable. One feature I've grown quite fond of in gmail is the ability to Archive messages instantly. This allows you to get more work done by leaving only the action items in your inbox (which is what an "inbox" really is, isn't it?).
Here's how you can accomplish this in Outlook (2007):
Option Explicit
Public Sub ArchiveSelectedItems()
MoveSelectedItemsToFolder "Pre Archive"
End Sub
Private Sub MoveSelectedItemsToFolder(FolderName As String)
On Error GoTo ErrorHandler
Dim Namespace As Outlook.Namespace
Set Namespace = Application.GetNamespace("MAPI")
Dim Inbox As Outlook.MAPIFolder
Set Inbox = Namespace.GetDefaultFolder(olFolderInbox)
Dim Folder As Outlook.MAPIFolder
Set Folder = Inbox.Folders(FolderName)
If Folder Is Nothing Then
MsgBox "The '" & FolderName & "' folder doesn't exist!", _
vbOKOnly + vbExclamation, "Invalid Folder"
End If
Dim Item As Object
For Each Item In Application.ActiveExplorer.Selection
If Item.UnRead Then Item.UnRead = False
Item.Move Folder
Next
Exit Sub
ErrorHandler:
MsgBox Error(Err)
End Sub
Now:
Optional:
(click to enlarge)
Here's how you can accomplish this in Outlook (2007):
- Open MS Outlook 2007
- Create a new sub-folder inside the Inbox named Pre Archive
- Under the Tools menu, select Macro > Visual Basic Editor (or Alt+F11)
- In the left menu bar, expand Project1, Microsoft Outlook Session, and open ThisOutlookSession
- Enter the following code:
Option Explicit
Public Sub ArchiveSelectedItems()
MoveSelectedItemsToFolder "Pre Archive"
End Sub
Private Sub MoveSelectedItemsToFolder(FolderName As String)
On Error GoTo ErrorHandler
Dim Namespace As Outlook.Namespace
Set Namespace = Application.GetNamespace("MAPI")
Dim Inbox As Outlook.MAPIFolder
Set Inbox = Namespace.GetDefaultFolder(olFolderInbox)
Dim Folder As Outlook.MAPIFolder
Set Folder = Inbox.Folders(FolderName)
If Folder Is Nothing Then
MsgBox "The '" & FolderName & "' folder doesn't exist!", _
vbOKOnly + vbExclamation, "Invalid Folder"
End If
Dim Item As Object
For Each Item In Application.ActiveExplorer.Selection
If Item.UnRead Then Item.UnRead = False
Item.Move Folder
Next
Exit Sub
ErrorHandler:
MsgBox Error(Err)
End Sub
Now:
- Save the code and exit the Visual Basic Editor
- Under View > Toolbars > Customize, select the Commands tab
- Click on Macros
- Drag Project1.ArchiveSelected command to any toolbar above
- Rename your button to Archive by right-clicking
- From the right-click, you can also Change Button Image
- Click Close
Optional:
- Open any message in the Inbox folder
- Click the Customize Quick Access Toolbar button on the title bar
- Select More Commands
- Add the Project1.ArchiveSelected command and configure the same way as above
- Make sure you have allowed Outlook to run macros.
2 comments:
golden goose outlet
adidas yeezy
goyard
yeezys
cheap jordans
supreme hoodie
lebron shoes
nike kyrie 5
kyrie 3 shoes
yeezy shoes
go to these guys high replica bags informative post designer replica luggage go to my blog designer replica luggage
Post a Comment