LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read Word Document

I must read Data from a formatted Word Document.
When i open the text with the "read text" i become a lot of trash, no text

Thanks for help

Thomas
0 Kudos
Message 1 of 4
(3,926 Views)
Thomas wrote in message
news:39a61ba0@newsgroups.ni.com...
>
> I must read Data from a formatted Word Document.
> When i open the text with the "read text" i become a lot of trash, no text
>
> Thanks for help

It'd help to know why you need to read the text.

You can't simply read a Word document from Labview, because it's not plain
text and, AFAIK, nobody has seen the need to write a text extractor to allow
Labview to extract text from a Word doc.

The simplest would be to save the documents from Word as plain text, that
can then be read by Word. Whether this is suitable or not depends on the
purpose.

Alternatively, you can use ActiveX to take control of Word and open the
document. From there you can retrieve text either an indi
vidual character or
a time, a line at a time (or sentence? I forget) or a paragraph at a time,
starting from a position that you define. You can also write text in the
same way- though I've not figured out how to read and write formatting
information (at some point I want to write an app that uses invisible marker
codes that it embeds in a document in order to manipulate it.).

I wrote a quick VI a while ago to test the various ways of retrieving text,
but I didn't bother to save it. If you need to take the ActiveX approach and
can't figure out where to start by yourself I can probably get some time to
cobble another together. I recall I figured it out just by the properties
and methods, without having to dig through the documentation, so it should
be fairly trivial.
0 Kudos
Message 2 of 4
(3,926 Views)
Hi Craig,

I am trying to do something similar to do what Thomas is working on. The difference being, I am trying to read several tables from a formatted MS Word. I have used report generation toolkit to write the tables from LV to MS word. The reason I wrote the tables to MS word is so that the user can get a neat looking printout. The reason i want to read from Word to LV is so that the user can modify the existing word file, but do that using LV and replace the existing word file. I would appreciate any suggestion or method to approach this problem preferrably without activex.

Thanks
0 Kudos
Message 3 of 4
(3,926 Views)

hi km76107,

i see that the prevoius questin u have given it long back. but all i ask is if you have found a solution for it please post it. i am also in need of a similar thing.

0 Kudos
Message 4 of 4
(2,837 Views)