C# .NET - MICROSOFT WORDPAD TEXT PASS TO TEXTBOX CONTROL USING ASP.NET

Asked By alakesh on 19-Mar-10 02:40 AM
I retrieve  byte from database table an convert to word.applcation class and get value from word.application class to textbox control
ut's working in local.i publish this application in main .it's not working .

ERROR DISPLAYED:COULD NOT OPEN MACRO STORAGE:


EXAMPLE PROGRAM:



                    string strPath = tempFilePath + "\\" + tempFile;


                    Word.ApplicationClass Readword = new Microsoft.Office.Interop.Word.ApplicationClass();

                    object file = strPath;
                    object nullobj = System.Reflection.Missing.Value;
                    object readOnly = false;

                    //Word.Document doc = Readword.Documents.Open(

                    Word.Document doc = Readword.Documents.Open(ref file,
                                        ref nullobj, ref readOnly, ref nullobj, ref nullobj, ref nullobj,
                                        ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj,
                                        ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj);
                    //
                    doc.Activate();
                    Word.Document doc1 = Readword.ActiveDocument;


                    string m_Content = doc1.Content.Text;
                    m_TxtSpecification.Text = m_Content;


                    //

                    //m_TxtSpecification.Text = data.GetData(windows.DataFormats.Text).ToString();

                    //doc.ActiveWindow.Selection.Copy();
                    //
                    //m_TxtSpecification.ReadOnly = true;
                    doc.Close(ref nullobj, ref nullobj, ref nullobj);
                    Readword.Quit(ref nullobj, ref nullobj, ref nullobj);
Adil Saud replied to alakesh on 19-Mar-10 03:25 AM
Hi Alakesh,

Make sure all the supported Dll's are well placed in the publish directory , specially check the bin folder.
Your code seems to be perfect.

One more thing at the time of development you the version of MS word you are using, should be installed on the machine where you deployed your web application, I guess this is the problem, you need to check that.

Let me know if you need any further information on the same.

Thanx,
Adil...:))