if (fileExt == ".doc" || fileExt == ".docx")
{
using (WordprocessingDocument wordDoc = WordprocessingDocument.Open(document,true))
{
string docText = null;
using (StreamReader sr = newStreamReader(wordDoc.MainDocumentPart.GetStream()))
{
docText = sr.ReadToEnd();
lbtext.Text = docText;
}
}
}
0
votes