Part # 2 : Working with SCL (Spam Confidence Level) programmatically

In this series, we will concentrate on how we can get the IMF SCL rating programmatically with Outlook 2003/2007 by calling the getSCL() method:

'[Outlook VBA : Code snippet]
Sub getSCL()
Set inbox = Outlook.ActiveExplorer.CurrentFolder 
Set items = inbox.items
'Implement Unstructured Exception handle 
On Error Resume Next 'should it encounter an error, it will proceed to the next item. 
For Each item In items 
If item.Class = olMail Then 
Set mail = item 
 'creates a user property called “SCL Rating” and adds the property to the folder
Set sclProp = mail.UserProperties.Add("SCL Rating", olText, True)
 'schema value for PR_CONTENT_FILTER_SCL
strSCL = mail.PropertyAccessor.GetProperty("") 
sclProp.Value = strSCL 
'saves the prop to the mail item
End If 
Set sclProp = Nothing 
End Sub 
Skip to main content