Dynamic generation of Word(.DOCX) file
private void NAR(object o)
{
try
{
System.Runtime.InteropServices.Marshal.ReleaseComObject(o);
}
catch { }
finally
{
o = null;
}
}
Microsoft.Office.Interop.Word.ApplicationClass oWord = new Microsoft.Office.Interop.Word.ApplicationClass();
*****
Your logic for dynamic generation of word file(in my case)
*****
NAR(oWord);
You are done. Now it should work as expected.
Happy coding..
Labels: .docx, comobject, dynamic generation, dynamics, generation, microsoft, microsoft word, msdn, release object, visual studio