Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.


Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Hi, I want to be able to read the

Hi, I want to be able to read the

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();
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 example is fine as well :)

Hope you can help.

RE: Hi, I want to be able to read the

See if this will help you:

RE: Hi, I want to be able to read the

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.

RE: Hi, I want to be able to read the

Sorry, I missed that. Yes you definitely need to have it installed, no other way.

RE: Hi, I want to be able to read the

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


"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close