Skip to content

Instantly share code, notes, and snippets.

@guinslym
Created August 21, 2018 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guinslym/298a329d77d9fb8552aa012c242bf70b to your computer and use it in GitHub Desktop.
Save guinslym/298a329d77d9fb8552aa012c242bf70b to your computer and use it in GitHub Desktop.
Sub Retrieve_http()
'our Outlook folder- deifinitions
Dim myItem As MailItem
Dim myFolder As Folder
Dim myNamespace As NameSpace
Set myNamespace = Application.GetNamespace("MAPI")
'put your folders name here
'1st one is store folder which should refer to firewall_support@iuass.org
'second is possibly 'inbox folder'
Set myFolder = myNamespace.folders("firewall_support@iuass.org").folders("inbox")
'destination file
Dim resFile As String
resFile = "c:\Users\Kazik\Desktop\httpRequest.txt"
Dim ff As Byte
ff = FreeFile()
'creating or opening it- each time you run this macro we will append data
'until deletion of either file or its content
Open resFile For Append As #ff
For Each myItem In myFolder.items
If InStr(1, myItem.Subject, "http://") > 0 And _
InStr(1, myItem.Subject, "classified under:") > 0 Then
'write to file
Write #ff, myItem.Subject
End If
Next
Close #ff
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment