c# - Trying fetch data from word document? -
i trying fetch data word document using
string mainer(string pathfile) { microsoft.office.interop.word.application word = new microsoft.office.interop.word.application(); object miss = system.reflection.missing.value; object path = pathfile; object readonly = true; microsoft.office.interop.word.document docs = word.documents.open(ref path, ref miss, ref readonly, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss); string totaltext = ""; (int = 0; < docs.paragraphs.count; i++) { totaltext += " \r\n " + docs.paragraphs[i + 1].range.text.tostring(); } docs.close(); word.quit(); word = null; docs = null; gc.collect(); return totaltext; }
i error the message filter indicated application busy. (exception hresult: 0x8001010a (rpc_e_servercall_retrylater))
using code in foreach suggestion error ?
Comments
Post a Comment