Jacqui1811
Programmer
Hi,
I want to be able to read the text from an uploaded word document into a string and save the string in a resx file.
I am fine doing this if the document is a txt or a html by using :
//// html and text doc this works.
StreamReader sr = new StreamReader(FileUpload.PostedFile.InputStream);
textString = sr.ReadToEnd();
sr.Close();
updateElement("MESSAGE_PORTAL_TERMS.Text", textString);
However if I do this with a .doc I get
��ࡱ�>�� QS����P����������������'` ��y;bjbj"9"9 .D@S@Sy3�������$�����$a%2����$�$�$�$�$�$�$$�&h�(�%�����%�%SSS�v�$S��$SS����4��g��$1%0a%�)I�)D�)\� �ZM@S�4�0���%%I ���a%����$$$� �$$$ $$$����
and then the text in the document inter-spaced with more of the weird characters.
My production server won't have office installed so I won't have access to the interop dll on there so without using office.interop is there any way I can read the text without the weird characters throughout?
Preferably with C# but vb.net example is fine as well
Hope you can help.
Thanks.
Jacqui.
I want to be able to read the text from an uploaded word document into a string and save the string in a resx file.
I am fine doing this if the document is a txt or a html by using :
//// html and text doc this works.
StreamReader sr = new StreamReader(FileUpload.PostedFile.InputStream);
textString = sr.ReadToEnd();
sr.Close();
updateElement("MESSAGE_PORTAL_TERMS.Text", textString);
However if I do this with a .doc I get
��ࡱ�>�� QS����P����������������'` ��y;bjbj"9"9 .D@S@Sy3�������$�����$a%2����$�$�$�$�$�$�$$�&h�(�%�����%�%SSS�v�$S��$SS����4��g��$1%0a%�)I�)D�)\� �ZM@S�4�0���%%I ���a%����$$$� �$$$ $$$����
and then the text in the document inter-spaced with more of the weird characters.
My production server won't have office installed so I won't have access to the interop dll on there so without using office.interop is there any way I can read the text without the weird characters throughout?
Preferably with C# but vb.net example is fine as well
Hope you can help.
Thanks.
Jacqui.