Sub ListRules() Dim colStores As Outlook.Stores Dim oFileSys As Object Dim oStore As Outlook.Store Dim oRoot As Outlook.folder Dim oCondition As Outlook.RuleCondition Dim oCondfrom As Outlook.RuleCondition Dim oAction As Outlook.RuleAction Dim colRules As Object Dim oRule As Outlook.Rule Dim oInbox As Outlook.folder Dim oMoveTarget As Outlook.folder Dim sOutput As String Dim myVar As Variant 'On Error Resume Next Set oFileSys = CreateObject("Scripting.FileSystemObject") 'Create a folder named Rules on your C drive or change the path to use an existing folder If oFileSys.FileExists("D:\OLfilterlist.txt") Then oFileSys.DeleteFile ("D:\OLfilterlist.txt") End If Open "D:\OLfilterlist.txt" For Output As #1 Set colStores = Application.Session.Stores Set oStore = colStores(1) Set oRoot = oStore.GetRootFolder Set colRules = oStore.GetRules For Each oRule In colRules sOutput = (oRule.ExecutionOrder) & Chr(9) & "Rule Name:" & (oRule.Name) & vbCrLf For Each oCondition In oRule.Conditions If oCondition.Enabled = True Then 'From If oCondition.ConditionType = olConditionFrom Then sOutput = sOutput & Chr(9) & "From:" & (oRule.Conditions.From.Recipients(1)) & vbCrLf End If 'Words in the Subject If oCondition.ConditionType = olConditionSubject Then 'use this format when the condition may contain multiple values sOutput = sOutput & Chr(9) & "Subject:" For Each myVar In oRule.Conditions.Subject.Text sOutput = sOutput & "'" & myVar & "' " Next sOutput = sOutput & vbCrLf End If If oCondition.ConditionType = olConditionBody Then sOutput = sOutput & Chr(9) & "Body:" & (oRule.Conditions.Body.Text) & vbCrLf End If If oCondition.ConditionType = olConditionMessageHeader Then sOutput = sOutput & Chr(9) & "Header:" & (oRule.Conditions.MessageHeader.Text) & vbCrLf End If If oCondition.ConditionType = olConditionBodyOrSubject Then sOutput = sOutput & Chr(9) & "Body Or Subject:" For Each myVar In oRule.Conditions.BodyOrSubject.Text sOutput = sOutput & "'" & myVar & "' " Next sOutput = sOutput & vbCrLf End If If oCondition.ConditionType = olConditionCategory Then sOutput = sOutput & Chr(9) & "Category:" For Each myVar In oRule.Conditions.Category.Categories sOutput = sOutput & "'" & myVar & "' " Next sOutput = sOutput & vbCrLf End If If oCondition.ConditionType = olConditionAccount Then sOutput = sOutput & Chr(9) & "Account:" & (oRule.Conditions.Account.Account) & vbCrLf End If If oCondition.ConditionType = olConditionAnyCategory Then sOutput = sOutput & Chr(9) & "AnyCategory:" & (oRule.Conditions.AnyCategory) & vbCrLf End If If oCondition.ConditionType = olConditionCc Then sOutput = sOutput & Chr(9) & "CC:" & (oRule.Conditions.CC.Enabled) & vbCrLf End If If oCondition.ConditionType = olConditionFlaggedForAction Then sOutput = sOutput & Chr(9) & "Flagged:" & (oRule.Enabled) & vbCrLf End If If oCondition.ConditionType = olConditionHasAttachment Then sOutput = sOutput & Chr(9) & "Attachment:" & (oRule.Conditions.HasAttachment.Enabled) & vbCrLf End If If oCondition.ConditionType = olConditionSenderAddress Then sOutput = sOutput & Chr(9) & "Sender:" & (oRule.Conditions.SenderAddress.Enabled) & vbCrLf End If End If Next For Each oAction In oRule.Actions If oAction.Enabled = True Then If oAction.ActionType = olRuleActionMoveToFolder Then sOutput = sOutput & Chr(9) & "Move To:" & (oAction.folder.FolderPath) & vbCrLf End If If oAction.ActionType = olRuleActionImportance Then sOutput = sOutput & Chr(9) & "Set Importance:" & (oAction.Enabled) & vbCrLf End If If oAction.ActionType = olRuleActionAssignToCategory Then sOutput = sOutput & Chr(9) & "Set Category:" & (oAction.Enabled) & vbCrLf End If If oAction.ActionType = olRuleActionRunScript Then sOutput = sOutput & Chr(9) & "Run Script:" & (oAction.Enabled) & vbCrLf End If If oAction.ActionType = olRuleActionDeletePermanently Then sOutput = sOutput & Chr(9) & "Delete Perm:" & (oAction.Enabled) & vbCrLf End If If oAction.ActionType = olRuleActionCopyToFolder Then sOutput = sOutput & Chr(9) & "Copy to:" & (oAction.folder.FolderPath) & vbCrLf End If If oAction.ActionType = olRuleActionForward Then sOutput = sOutput & Chr(9) & "Forward:" & (oAction.Enabled) & vbCrLf End If End If Next Print #1, sOutput Next Close #1 End Sub