D
Dan
I am using Outlook 2007 and VB6. I am using Outlook Automation in a VB
program to choose certain Outlook messages from a folder called Archive, save
them as MSG files, and then delete the messages. It works fine when only
email messages are in the folder.
But occasionally I subscribe to RSS feeds, and sometimes I drag the messages
from the RSS feeds to the Archive folder. I have to skip over those because I
can't treat them as MailItem objects.
Here is a simplified view of the code I'm using:
Dim DateTimeStr As String
Dim FilterStr As String
Dim Message As Outlook.MailItem
Dim MessageFolder As Object
Dim MessageList As Object
Dim ObjItem As Object
Dim OutlookApp As Object
Dim OutlookNamespace As Object
Dim SelectedOutlookFolder as Outlook.Folder
Set OutlookApp = GetObject(, "Outlook.Application")
Set OutlookNamespace = OutlookApp.GetNamespace("MAPI")
Set MessageFolder =
OutlookNamespace.GetFolderFromID(SelectedOutlookFolder.EntryID,
SelectedOutlookFolder.StoreID)
DateTimeStr = Format("7/1/2009 12:00am", "ddddd h:nn AMPM")
FilterStr = "[SentOn] < '" & DateTimeStr & "'"
Set MessageList = MessageFolder.Items.Restrict(FilterStr)
If Not MessageList Is Nothing Then
For Each ObjItem In MessageList
Set Message = Nothing
On Error Resume Next
Set Message = ObjItem
If Not Message Is Nothing Then
End If
Next ObjItem
End If
Is there any way that I can test for the RSS feed messages in this same loop
and save them as MSG files also? Thanks for your help.
program to choose certain Outlook messages from a folder called Archive, save
them as MSG files, and then delete the messages. It works fine when only
email messages are in the folder.
But occasionally I subscribe to RSS feeds, and sometimes I drag the messages
from the RSS feeds to the Archive folder. I have to skip over those because I
can't treat them as MailItem objects.
Here is a simplified view of the code I'm using:
Dim DateTimeStr As String
Dim FilterStr As String
Dim Message As Outlook.MailItem
Dim MessageFolder As Object
Dim MessageList As Object
Dim ObjItem As Object
Dim OutlookApp As Object
Dim OutlookNamespace As Object
Dim SelectedOutlookFolder as Outlook.Folder
Set OutlookApp = GetObject(, "Outlook.Application")
Set OutlookNamespace = OutlookApp.GetNamespace("MAPI")
Set MessageFolder =
OutlookNamespace.GetFolderFromID(SelectedOutlookFolder.EntryID,
SelectedOutlookFolder.StoreID)
DateTimeStr = Format("7/1/2009 12:00am", "ddddd h:nn AMPM")
FilterStr = "[SentOn] < '" & DateTimeStr & "'"
Set MessageList = MessageFolder.Items.Restrict(FilterStr)
If Not MessageList Is Nothing Then
For Each ObjItem In MessageList
Set Message = Nothing
On Error Resume Next
Set Message = ObjItem
If Not Message Is Nothing Then
End If
Next ObjItem
End If
Is there any way that I can test for the RSS feed messages in this same loop
and save them as MSG files also? Thanks for your help.