Hello jmcilhinney, very useful code, thank you very much.
I tried it in combination of OpenFileDialog() but seems not working, there is an "Exception thrown: 'System.Threading.ThreadStateException' in System.Windows.Forms.dll" do you know how to resolve it ?