INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

Join Tek-Tips
*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.

Jacqui1811 (Programmer) (OP)
17 May 12 23:27
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.
jbenson001 (Programmer)
18 May 12 8:38
See if this will help you:
http://www.codeproject.com/Articles/3959/Microsoft-Word-Documents-from-ASP-NET
Jacqui1811 (Programmer) (OP)
18 May 12 9:03
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.
jbenson001 (Programmer)
18 May 12 9:28
Sorry, I missed that. Yes you definitely need to have it installed, no other way.
MarkSweetland (MIS)
18 May 12 9:37

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

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