Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET POP3

 AfterLogic Forum : MailBee.NET POP3
Subject Topic: only one attachment from attachmentcollec Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
hr-pb
Newbie
Newbie


Joined: 06 December 2008
Online Status: Offline
Posts: 12
Posted: 05 June 2009 at 6:03am | IP Logged Quote hr-pb

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 View hr-pb's Profile Search for other posts by hr-pb
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 05 June 2009 at 7:34am | IP Logged Quote Igor

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 View Igor's Profile Search for other posts by Igor
 
hr-pb
Newbie
Newbie


Joined: 06 December 2008
Online Status: Offline
Posts: 12
Posted: 16 June 2009 at 4:08am | IP Logged Quote hr-pb

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 View hr-pb's Profile Search for other posts by hr-pb
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide