01-14-2016 02:54 PM
I am having difficulty with the active x progrmaming with MS Word. My VI simply runs thru a directory and opens each word document and converts it to text and accumulates it into an array. My problem is that MS word does not close each file after loading it in each iteration. What am I doing wrong?
Solved! Go to Solution.
01-14-2016 03:04 PM - edited 01-14-2016 03:05 PM
Use the _Document Close method as the last thing in the FOR loop (close the document reference after). Also you should get the Documents collection only once BEFORE the FOR loop and close this reference first thing after the FOR loop. Before closing the _Application reference you could use the Quit method to close Word and then close the _Application reference.
Ben64
01-14-2016 03:57 PM
Since you are using LabVIEW 2014, have you considered using the Report Generation Toolkit functions instead of ActiveX? I don't have as much experience using the Word functions, but I've done a lot with Excel and have also used them to generate HTML Reports. Very simple, well-documented, fewer "hidden tricks" ...
Bob Schor
01-15-2016 06:56 AM
Ben You saved me a lot of headaches as usual. Thanks. It works Kudos!
01-15-2016 07:25 AM
@id wrote:
Ben You saved me a lot of headaches as usual. Thanks. It works Kudos!
Then you should mark my post as the the accepted soluton
Ben64