Office automation: Outlook 2010 randomly renames file attachments

Alternative Title: Guess what I wasted the past 2 days on?

We recently got a bug report from one of our contractors. They told us that the attached files they had received via outlook was not named correctly. In fact, of the 10 attachments in that email, only 1 of them had a name matching the file within. And after a little digging we found out this had been going on for roughly 1½ weeks. I will leave it to you to imagine how many files and mails this affected. The file names of the attachments were internally switched. So the file name of file 1 was used for file 3 and file name of file 3 was used for file 8 and so on…. big mess.


I started an intensive bug hunt. Both in the application (Access of course) that actually creates the files, as well as the application we use to send the files and track submittal date and such (Access too of course, with Outlook Automation).  Initially I couldn’t seem to reproduce the error, so I went through the code, of both applications, row by agonizing row to make sure all was as it should be. I couldn’t find any issue, so started again to test, and now I could reproduce the error, but only sometimes. I thought maybe it was an outlook problem, but my initial search of the web came up empty. So I started to create test scenarios and spent/wasted a great deal of time on that. Intermittent non-consistent bugs are any programmers nightmare. Even if you think you tracked it down and “solve it” you are never sure if it’s truly solved, or the bug is just not occurring right now.

Finally I did pin it exclusively to Outlook, by validating the file names before and after sending it through outlook, to confirm that none of my applications was at fault. And then I also managed to find a blog entry from the Japanese office support team describing this problem. Tracing back, I can see that the first “bad” mails were sent right after a series of patches were distributed by our IT policy about 1½ weeks ago (sept 17th to be exact). The update in question were KB3085522 which is not the same as listed in the japanese blog post, but I honestly don’t know why that is, or whether they are just regional versions of the same thing. Now to track down


The blog entry lists a couple of workarounds for what its worth, one of which is to save to the draft folder, then send it from there.


Posted in Misc.

Ask a question, leave some feedback, post a reply!