Author |
|
hr-pb Newbie
Joined: 06 December 2008
Online Status: Offline Posts: 12
|
Posted: 05 June 2009 at 6:03am | IP Logged
|
|
|
Hi,
How can I save only one attachment from attachment collection ?
my code :
if (att.IsTnef)
{
AttachmentCollection coll = att.GetAttachmentsFromTnef();
}
in coll is 4 attachments, I need to save ONLY first, please help
|
Back to Top |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 05 June 2009 at 7:34am | IP Logged
|
|
|
Code:
AttachmentCollection coll = attach.GetAttachmentsFromTnef();
Attachment att1 = coll[0];
att1.SaveToFolder(@"C:\Attachments\", true); |
|
|
We recommend to check if this collection contains any elements, otherwise the above code may cause an exception.
--
Regards,
Igor, AfterLogic Support
|
Back to Top |
|
|
hr-pb Newbie
Joined: 06 December 2008
Online Status: Offline Posts: 12
|
Posted: 16 June 2009 at 4:08am | IP Logged
|
|
|
Igor wrote:
Code:
AttachmentCollection coll = attach.GetAttachmentsFromTnef();
Attachment att1 = coll[0];
att1.SaveToFolder(@"C:\Attachments\", true); |
|
|
We recommend to check if this collection contains any elements, otherwise the above code may cause an exception.
--
Regards,
Igor, AfterLogic Support |
|
|
but this error occurs here :
AttachmentCollection coll = att.GetAttachmentsFromTnef();
|
Back to Top |
|
|