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.
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.
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" ...
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