RameshSivaraju -1 Newbie Poster

I am trying to automate MS Word in my web application.
I have added reference of Object Library 11.0 version. Still i am unable to run it properly. Moreover the problem is raising only after i publish it to IIS, otherwise it is running properly.

The exception i am getting is

System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {00020906-0000-0000-C000-000000000046} failed due to the following error: 80070005. at PrintReports.FindReplaceAll(Boolean cbMastCert, Boolean cbMailLabels, Boolean cbMastCong) in c:\Inetpub\wwwroot\CMS\PrintReports.aspx.cs:line 701

Moreover the exception is raised when i try to create an Object of ApplicationClass or Word or Document (those from Office.Interop.Word dll).

If it try it through StreamReader or StreamWriter even if i read content of word file into a stringBuilder, i am getting junk characters into that. I think StreamReader is not intended to read Word Documents it is only for plain text.

Thank you in advance.