Fix System.OutOfMemory exception in a little vb.net script -- 2

Job ID: 33965369

Budget: $10 – $30 USD

I've attached a script that is reading emails from Exchange server, exporting them to a folder into pdf and also saving the path and contents into an access database.

The script is working. But the problem is that the resource usage is very high and it ends up crashing after hours of running.

This is a very little script which should not have such a bad performance.
Related categories: .NET Microsoft Access Microsoft Exchange VB.NET