![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I have a Problem of creating a large number of emails with attachments.
Everything works fine, but when the 100th mail is created and the attachment is added mail.Attachments.Add(fileName, (int)OlAttachmentType.olByValue, mail.Body.Length + 1, "My Attachment"); throws an Exception telling me the following: (Translated from German) The file filename cannot be created. Check the permissions of the folder where you want to create the file. The code for creating all the mails is the following: foreach (Recipient rec in Recipients){ _MailItem mail = outlookApp.CreateItem(OlItemType.olMailItem); mail.To = rec.address; mail.Body = rec.body; mail.Subject = rec.subject; mail.Attachments.Add(rec.pathToAttachment, (int)OlAttachmentType.olByValue, mail.Body.Length + 1, "My Attachment"); mail.Save(); mails.Add(mail); //save mails references in an Arraylist to be able to send them later, after checking mails in Draftfolder. } Can anyone help me with this problem Thanks |
Ads |
#2
|
|||
|
|||
![]()
See my response to your other post on this issue.
-- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Ferdinand Zaubzer" wrote in message ... I have a Problem of creating a large number of emails with attachments. Everything works fine, but when the 100th mail is created and the attachment is added mail.Attachments.Add(fileName, (int)OlAttachmentType.olByValue, mail.Body.Length + 1, "My Attachment"); throws an Exception telling me the following: (Translated from German) The file filename cannot be created. Check the permissions of the folder where you want to create the file. The code for creating all the mails is the following: foreach (Recipient rec in Recipients){ _MailItem mail = outlookApp.CreateItem(OlItemType.olMailItem); mail.To = rec.address; mail.Body = rec.body; mail.Subject = rec.subject; mail.Attachments.Add(rec.pathToAttachment, (int)OlAttachmentType.olByValue, mail.Body.Length + 1, "My Attachment"); mail.Save(); mails.Add(mail); //save mails references in an Arraylist to be able to send them later, after checking mails in Draftfolder. } Can anyone help me with this problem Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
'Display Name' Property for Attachments.Add Method | Ned Moorfield | Outlook and VBA | 0 | May 18th 06 09:06 AM |
Outlook Interop COM Exception When Logged in as Windows Standard User | [email protected] | Add-ins for Outlook | 0 | April 27th 06 12:34 AM |
New Outlook.Application throws FileNotFoundException | Sue | Outlook and VBA | 10 | April 6th 06 06:51 AM |
Outlook 2003 throws an unhandled exception when I save a new item | Engineer Rick | Outlook - Calandaring | 0 | January 30th 06 05:57 AM |
Problem installing outlook interop. PRO11.MSI not recognized | Jason | Outlook - Using Forms | 0 | January 11th 06 06:02 PM |