![]() |
#2
|
||||
|
||||
![]()
Based on your comments, create a new category 'Completed' and apply it to messages that are completed. Perhaps better still, create a new mail folder, again called 'Completed' (or whatever suits you better) and move the completed messages to it. The following Outlook macro will categorise the message as completed and move it to a sub folder of Inbox called 'Completed', which it will create if not already present,
Code:
Option Explicit Sub CompletedMsg() Dim olMsg As MailItem Dim olFolder As Outlook.Folder Dim bExists As Boolean Const sFolderName As String = "Completed" 'the name of the Completed folder On Error Resume Next Select Case Outlook.Application.ActiveWindow.Class Case olInspector Set olMsg = ActiveInspector.currentItem Case olExplorer Set olMsg = Application.ActiveExplorer.Selection.Item(1) End Select For Each olFolder In Session.GetDefaultFolder(olFolderInbox).folders If olFolder.Name = sFolderName Then bExists = True Exit For End If Next olFolder If Not bExists = True Then Set olFolder = Session.GetDefaultFolder(olFolderInbox).folders.Add(sFolderName) End If olMsg.UnRead = False olMsg.Categories = "Completed" 'optional olMsg.Move olFolder lbl_Exit: Set olMsg = Nothing Set olFolder = Nothing Exit Sub End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Share contacts but keep the email address hidden from users, use these contacts to send a email | Dispatcher7 | Outlook | 0 | 03-23-2021 05:30 AM |
How can I access an Outlook email address that was created some time ago? | Tom Prendergast | Outlook | 0 | 02-03-2020 05:02 PM |
Can I prevent certain users from seeing email address of certain users in the recipient/sender field | sevenpcb | Outlook | 0 | 08-21-2017 10:11 AM |
![]() |
wgutshall | Excel | 3 | 07-10-2015 08:44 AM |
Display txt in real-time | Prostrelov | Word | 13 | 06-21-2014 08:48 AM |