Hi,
Was wondering if anybody knew the syntax for moving an e-mail to another folder in a macro.
I've got a macro that strips the attachments and puts them in folders on various network drives, then it marks the file as read, and after than, I want to move it to a folder called "InboxDone".
Example:
Dim NewMailTime As Date
Dim NewItems As Items
Dim InboxItems As Items
Dim NewMailItem As MailItem
Dim MyAttachment As Attachment
Dim vNewFileName As String
For Each NewMailItem In InboxItems
If NewMailItem.UnRead Then
If NewMailItem.SenderName = "My Boss" _
And InStr(1, LCase(NewMailItem.Subject), "bossfile"
Then
For Each MyAttachment In NewMailItem.Attachments
vNewFileName = MyAttachment.FileName
MyAttachment.SaveAsFile "O:\BossFiles\" + vNewFileName
NewMailItem.UnRead = False
? NewMailItem.Move (InboxDone) ?
Next
End If
Next
-----
The death of dogma is the birth of reason.
Was wondering if anybody knew the syntax for moving an e-mail to another folder in a macro.
I've got a macro that strips the attachments and puts them in folders on various network drives, then it marks the file as read, and after than, I want to move it to a folder called "InboxDone".
Example:
Dim NewMailTime As Date
Dim NewItems As Items
Dim InboxItems As Items
Dim NewMailItem As MailItem
Dim MyAttachment As Attachment
Dim vNewFileName As String
For Each NewMailItem In InboxItems
If NewMailItem.UnRead Then
If NewMailItem.SenderName = "My Boss" _
And InStr(1, LCase(NewMailItem.Subject), "bossfile"
For Each MyAttachment In NewMailItem.Attachments
vNewFileName = MyAttachment.FileName
MyAttachment.SaveAsFile "O:\BossFiles\" + vNewFileName
NewMailItem.UnRead = False
? NewMailItem.Move (InboxDone) ?
Next
End If
Next
-----
The death of dogma is the birth of reason.