LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

closing word table doesnt work

Solved!
Go to solution
Highlighted

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? 

0 Kudos
Message 1 of 5
(1,106 Views)
Solution
Accepted by tst

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

--------------------------------------------------
The best way to say thanks is to give kudos!
Message 2 of 5
(1,101 Views)

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

0 Kudos
Message 3 of 5
(1,078 Views)
Solution
Accepted by topic author id

Ben You saved me a lot of headaches as usual.  Thanks.  It works Kudos!

0 Kudos
Message 4 of 5
(1,027 Views)

@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 Smiley Happy

 

Ben64

--------------------------------------------------
The best way to say thanks is to give kudos!
0 Kudos
Message 5 of 5
(1,017 Views)