S
-=Sojourn=-
I'm trying to processing forwards that come into my account. I
have emails that have fowarded emails, within forwared emails, with
forwarded emails... etc.. etc. etc... then the actual message..
What I want to do is have outlook process the emails so just the actual
message is there...
Sub Unknown()
' Dim a bunch of variables...
Set oNameSpace = Application.GetNamespace("MAPI")
Set ofInbox = oNameSpace.GetDefaultFolder(olFolderInbox)
Set SubFolder = ofInbox.Folders("Temp")
iFor = 1
Do
If SubFolder.Items(iFor).Class = olMail Then
Set oMail = SubFolder.Items(iFor)
For Each att In oMail.Attachments
sExt = LCase(Right(att.FileName, 3))
If sExt = "jpg" Then Exit For
If sExt = "gif" Then Exit For
If sExt = "msg" Then
Set oMailNew = att ' <--- This line doesn't work
End If
Next att
Set oMail = Nothing
End If
iFor = iFor + 1
Loop Until iFor >= (SubFolder.Items.Count - 1)
End Sub
Any help would be appreciated...
Thanks!
have emails that have fowarded emails, within forwared emails, with
forwarded emails... etc.. etc. etc... then the actual message..
What I want to do is have outlook process the emails so just the actual
message is there...
Sub Unknown()
' Dim a bunch of variables...
Set oNameSpace = Application.GetNamespace("MAPI")
Set ofInbox = oNameSpace.GetDefaultFolder(olFolderInbox)
Set SubFolder = ofInbox.Folders("Temp")
iFor = 1
Do
If SubFolder.Items(iFor).Class = olMail Then
Set oMail = SubFolder.Items(iFor)
For Each att In oMail.Attachments
sExt = LCase(Right(att.FileName, 3))
If sExt = "jpg" Then Exit For
If sExt = "gif" Then Exit For
If sExt = "msg" Then
Set oMailNew = att ' <--- This line doesn't work
End If
Next att
Set oMail = Nothing
End If
iFor = iFor + 1
Loop Until iFor >= (SubFolder.Items.Count - 1)
End Sub
Any help would be appreciated...
Thanks!