T
Torsten Piehl
Outlook Experts,
I wrote a OL2003 macro to (1) save an OL.MailItem in filesystem
and to (2) remove the attachment(s).
This is the code so far:
Private Sub SaveMail(myMailObj As MailItem)
(1) myMailObj.SaveAs sFilePath, olMSG
...
(2) nMax = myMailObj.Attachments.Count
For i = 1 To nMax
sAttachements = sAttachements & "<" &
myMailObj.Attachments.Item(i).FileName & "> "
myMailObj.Attachments.Item(i).Delete
Next i
myMailObj.Body = p_myObj.Body & vbCRLF & sAttachements
myMailObj.Save
...
(3) MoveMail myMailObj
...
End Sub
Problem:
Change selected item in view, return to item and open it. The mail still
contains their attachments!!!
(If you do not change the selection and open the edited item, the mail does
not contain any attachments, macro works fine!)
Evaluation: In step (3), I moved the mail to an backup folder in
OL.ActiveExplorer. Step (2) works fine!
Aggregation: The macro deletes the mail attachments when moving the mail.
If the mail will not moved, the attachments will recurring if the mail is
revisited!
Any ideas?
Thanks in advance!
Torsten Piehl
I wrote a OL2003 macro to (1) save an OL.MailItem in filesystem
and to (2) remove the attachment(s).
This is the code so far:
Private Sub SaveMail(myMailObj As MailItem)
(1) myMailObj.SaveAs sFilePath, olMSG
...
(2) nMax = myMailObj.Attachments.Count
For i = 1 To nMax
sAttachements = sAttachements & "<" &
myMailObj.Attachments.Item(i).FileName & "> "
myMailObj.Attachments.Item(i).Delete
Next i
myMailObj.Body = p_myObj.Body & vbCRLF & sAttachements
myMailObj.Save
...
(3) MoveMail myMailObj
...
End Sub
Problem:
Change selected item in view, return to item and open it. The mail still
contains their attachments!!!
(If you do not change the selection and open the edited item, the mail does
not contain any attachments, macro works fine!)
Evaluation: In step (3), I moved the mail to an backup folder in
OL.ActiveExplorer. Step (2) works fine!
Aggregation: The macro deletes the mail attachments when moving the mail.
If the mail will not moved, the attachments will recurring if the mail is
revisited!
Any ideas?
Thanks in advance!
Torsten Piehl