count character of word document using asp.net
-
Hello Friends,How are you, In my web application I wanna count no. of characters in ms-word document.I am using reference of com. and Wrote the Code as object filePath="d:\\Test\\test.doc"; object readOnly=false; object missing=System.Reflection.Missing.Value; Word.ApplicationClass wa=new Word.ApplicationClass(); Word.Document cc=wa.Documents.Open(ref filePath,ref missing,ref readOnly,ref missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref missing,ref missing); int coun=cc.Characters.Count; wa.Application.Quit(ref missing,ref missing,ref missing); Button1.Text=coun.ToString(); But After running this there is an error of macro. Is there any other way of doing this or How can I remove this error. rajkumar Sharma