LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"Using LabVIEW 5.1 on WinNT, how can I replace text at a specific location in a preformated MS Word97 document and then print the document specifying the printer port and/or name? I suspect using an ActiveX approach."

"I have been able to replace text in a preformatted Excel97 file (specifying the row/column cell location)and print it using ActiveX automation. I need to do something similar for Word97 and specify a printer path, port and/or name."
0 Kudos
Message 1 of 3
(2,691 Views)
It is hard to give specific information about activeX calls on MS Office because MS changes the interface every release. I have done something simmilar by saving the document to file, reading that file as a string into LabVIEW, and performing a search and replace for specific words. You may have to save the file to .txt to simplify the file headers.

You might be interested in the Report Generation Toolkit for Word and Excel. This not really an interface for freely editing word and excel documents but if you are generating a report, it can't be beat.

As for the printing goes, it sounds like it would be a method for a document. I know that IE 5.5 has a dialog box option so at the very least, you can use activeX to print the word document that way.
0 Kudos
Message 2 of 3
(2,691 Views)
Hello Kenos,

If you were working with plain text, it would be a simple matter to use the offset function of search string node. However, since Word documents have a HUGE amount of nonstandard characters for formatting (even RTF format is pretty scary in this regard), you will probably have to use the Search for Tokens, and explicitly define what you consider to be "text" as opposed to formatting symbols. This is "doable", but certainly not fun. Since formatted Word documents can only be read with an actual WORD application....are you sure you can't automate this better with a Word macro? It might be easier to call up WORD from within Labview than to actually do these word processing functions with Labview directly.

Just a thought

chutla
Eric P. Nichols
P.O. Box 56235
North Pole, AK 99705
0 Kudos
Message 3 of 3
(2,691 Views)