471,337 Members | 902 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

doc file

Is there a way to read a .doc file text into a listBox?
Hrcko
Jan 3 '06 #1
3 1566
Hrcko,
Assuming that in this context "doc" means a Microsoft Word document file,
no, as Word documents are stored in a binary format. You would either need to
convert the file and save it as text (using Word, for example) or use the
Word Object Model to load and read the document and get the text that way.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Hrvoje Voda" wrote:
Is there a way to read a .doc file text into a listBox?
Hrcko

Jan 3 '06 #2
> Is there a way to read a .doc file text into a listBox?

As Peter says, you can't do it directly. You could create a
Microsoft.Office.Interop.Word.Application instance, and then use
Documents.Open(...) to load up your file and read from it
programmatically; this however requires the end user to have a recent
version of Word installed and is rather heavy on resources.

Jan 3 '06 #3
Hi,
"Hrvoje Voda" <hr*********@luatech.com> wrote in message
news:dp**********@ss405.t-com.hr...
Is there a way to read a .doc file text into a listBox?


You need to provide more details , a .doc file is more suitable to a
Textbox than to a listbox


--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Jan 3 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by matt | last post: by
7 posts views Thread by Joseph | last post: by
3 posts views Thread by StGo | last post: by
3 posts views Thread by Shapper | last post: by
reply views Thread by thjwong | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.