Error while attaching attachments via code

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

I have a piece of vba code in ms access that sends emails with attachments
via outlook automation. This code has been running fine for years and this
problem has only recently come up. The problem is that the code runs and
sends emails with attachments to around 100 or so people and then the code
in Access stops on the line;

objOutlookMsg.Attachments.Add "F:\Folder 1\8 Mailshots\2008\Feb 08 (2).doc"

with the below error;

Automation error (Error 440)

err.Number: -36683771

err.Description: Can't create file: Feb 08 (2).doc. Right-click the folder
you want to create the file in, and then click Properties on the shortcut
menu to check your permissions for the folder.

err.Source: Microsoft Office Outlook

If I continue the code after a few seconds pause then another few emails are
sent before this error comes up again and this process goes on. The outlook
version is 2003 and Exchange is 2003. Any help in resolving this problem
would be appreciated. Could it be there is a problem with exchange instead
of outlook and it is refusing to accept too many attachments at a time? As I
said this has been working fine for years with same code, outlook and
exchange versions. That is why it is confusing as to what suddenly went
wrong.

Thanks

Regards
 
This is a long shot, but check Outlook's securetemp folder to see how many
"feb 08" documents have when the error hits. Just so you know, Outlook can
only create 99 of them before wigging. (and the way it would number is up
"Feb 08 (99)" before throwing an error when it comes to opening said
attachment.

To determine what Outlook is using as a secure temp folder under Outlook
2003 is to open regedit and navigate to:
HKCU\Software\Microsoft\Office\11.0\Outlook\Security and check out the
SecureTemp value on the right.
 
Back
Top