LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to edit an existing word file with Report Generation Toolkit?

Hi,

 I want to  edit an existing word file (.doc) with Report Generation Toolkit? How to save it without saving as a  new word file? 

 

1. Open an existing word file, edit it, and save.

2. the existing word file mustn't show on the screen.

 

Thanks a lot

0 Kudos
Message 1 of 3
(3,037 Views)

See read from Excel data. Maybe this help you.

For word you shell change activeX reference to Microsoft office word.

0 Kudos
Message 2 of 3
(3,007 Views)

I've used the RGT a lot for Excel, not so much for Word (actually, not at all!), but I just wrote some Test Code for myself (I suggest you also try such "small LabVIEW Experiments" to test ideas about how LabVIEW really works) and think what I'm about to say is correct ...

  • To open an existing Word File, use New Report with Word as the Report Type and the Word document (.doc or .docx) that you want to open as the Template.
  • If you don't want the file to show on the screen, you can open Word "Minimized" (the Window State).  Note that Word is still running, and visible in the Task Bar -- I don't think you can (easily) prevent users from clicking there and opening Word, if that is your aim.
  • Now you can execute any of the Word-specific Functions of the RGT.  Of course, you won't see the effects because the Window is minimized.
  • When you are done, you need to do a Save Report.  This also requires a File Name, which can be the same as the File Name you used for the Template (in which case it will overwrite the original).  Following this, use Dispose Report to close Word.
  • Note that if you do Dispose Report without doing Save Report, your changes will not be saved.

As I said at the top, write yourself a little test program and try this out.  I use this all the time with Excel, and have "tested" it with Word without doing much more than opening and closing a file, and it seems to work as I would expect.

 

Bob Schor

0 Kudos
Message 3 of 3
(2,994 Views)