Before I give you some tips on getting that error code, here's something I found on Microsoft support website:
Microsoft does not currently recommend, and does not support,
Automation of Microsoft Office applications from any unattended,
non-interactive client application or component (including ASP,
ASP.NET, DCOM, and NT Services), because Office may exhibit unstable
behavior and/or deadlock when Office is run in this environment.
Reference: http://support.microsoft.com/kb/257757 <- might be a good read. It may or may not be applicable to your situation.
To get the last error, you would use:
System.Runtime.InteropServices.Marshal.GetLastWin32Error()
http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshal.getlastwin32error.aspx
Since you're trying to get the code, this may very well work:
System.Runtime.InteropServices.Marshal.GetExceptionCode()
http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshal.getexceptioncode(v=vs.110).aspx
You might have to use PInvoke:
http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.setlasterror.aspx
Here's an SO thread does a good job of explanining what needs to be done. The example there might not have the same code as yours, but it provides a good reference point. Unfortunately, I do not see enough of your code in your screenshot:
https://stackoverflow.com/a/17918729/2006048