07-23-2011 11:51 AM
Hello forum users,
I would like to add a table of contents to a MS Word document, using the Report Generation Toolkit.
I couldn't find a VI in the toolkit that does that, so I tried to modify the VI "Word Insert Field.vi". Doing so, I could access a property node of the class "Word._Document" and an invoke node of the class "Word.TablesOfContents" with the method "Add".
As this modified VI does not belong to the private LabVIEW class "NI_Word.lvclass", it is not possible to unbundle the (type cast) "report in" wire to get the "Word._Document" class reference. I can't add the modified VI to the NI_Word class either, because it is password protected.
There are so many methods and properties that are not used in the official Report Generation Toolkit, like this one. How can I access them?
Or maybe there is another way to add a table of contents to a MS Word document (programmatically). Maybe I have to use a template. I rather wouldn't, though.
Operating System: Windows 7 64bit
LabVIEW: 2009 [9.0 (32bit)]
Report Generation Toolkit: 2009
MS Office: 2003 SP1
Thank you for reading an answering.
Solved! Go to Solution.
07-23-2011 02:47 PM
Hello again,
in the "Word Specific" > "Word Advanced" Palette of the Report Generation Toolkit, there is a VI called "Word Get ActiveX References" which essentially unbundles the private "report" data stream / wire. Thus, I can use the property and invoke nodes that make use of the "Add TablesOfContents" method.
I hope, that helps other users as I didn't find too many topics on Report Generation. Maybe it's just too easy...