Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, I want to be able to read the

Status
Not open for further replies.

Jacqui1811

Programmer
Jul 8, 2002
100
SG
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.
 
Hi,
Thanks for the link but my production server won't have word installed and this references the word.application class. Unless I am mistaken I would need to install word to gain access to this.
Sorry I thought I mentioned in the OP the main problem is no office/word will be there.
Many thanks for your help though.
Jacqui.
 
Sorry, I missed that. Yes you definitely need to have it installed, no other way.
 

Here is a link to Microsoft's support site that warns about using server-side automation of Office componenets. It also includes links to alternatives that may help you out...

Article ID: 257757


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top