hi all
i've been strugling with this error. could someone help me. below is the code
stremail = "some@email"
For Each store In outlookapp.Session.Stores
strchecking = store.DisplayName
outlookfolder = store.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)
For Each objfolder In outlookfolder.Folders
For Each obj As Object In objfolder
If TypeOf (obj) Is Outlook.MailItem Then
MsgBox(obj.Subject)
End If
Next
Next
Next
the error says : "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
and it appears in this line outlookfolder = store.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)