10-23-2023 11:22 AM
Hello,
I am using the Report Generation Toolkit to add various items to a test datasheet. I have assigned bookmarks to places where the values will be input to the datasheet. The issue that I am having is that it is very time consuming to go through and change each bookmark. I've tried using the Find and Replace feature but it doesn't seem to have the option to select all of the MS Office Parameters bundles and do a group replace.
Is there a way to make this work?
Solved! Go to Solution.
10-23-2023 11:53 AM
When you mention bookmarks, I assume you are talking about Word. The DOCX format (and all other Office formats, i.e. XLSX, PPTX) is just a zipped file, which means you can change the file extension to .zip and view the file contents. Within the ZIP file, in the 'word' folder, is a document.xml that contains all the content of your document. Use the text function (search and replace, etc) to add your data.
10-23-2023 12:02 PM
Thanks for the reply. I'm referring to the bookmarks in Labview, not not in the word template.
10-23-2023 12:39 PM
Are you trying to change the name of the bookmark in the code to match what is in the docx? In what way are you trying to change the bookmark? Technically, there are no bookmarks in LabVIEW, so the way you phrase your comments is confusing. The bookmark is in the Word template and you reference the name of the bookmark in your code to insert text at that location. Here is how to do that with the RGT:
Or you can use the method I described above to add text using the File I/O functions.
10-23-2023 03:29 PM - edited 10-23-2023 03:29 PM
Below are what I referred to as the MS Office Parameters "bundle". Part of this includes a place to specify a bookmark in the word document that you are appending. Say that I have a group of these with bookmarks such as, "C917_Pass_Fail32_1_1, C917_Pass_Fail32_1_2,...", and I would like to use find and replace to change the 32 in all of the designations to 18, is there a way to do that in Labview?
10-23-2023 03:39 PM
The Find and Replace will do that. Make sure the text option is selected. Search for Fail32 and replace it with Fail18
10-23-2023 03:58 PM
That did the trick. I wish it gave you the option to find and replace what is selected within a VI, but I just copied all of the ones that I wanted to change into a new VI and selected to change everything within that VI. Thanks for your help.
10-23-2023 03:59 PM
@T_Black wrote:
Below are what I referred to as the MS Office Parameters "bundle". Part of this includes a place to specify a bookmark in the word document that you are appending.
Yes I know what the MS Office Parameters bundle is (there is only ONE in my code). Again, please review my suggestion above about using arrays and for loops to build those clusters rather than creating 100 cluster constants and wiring them together on your block diagram. You are obfuscating a large portion of the functionality of your code behind those cluster icons. Imagine, in the future, trying to figure out what was in those clusters and what would be involved to debug your code or add another bookmark.
10-23-2023 04:06 PM
Nice trick. I didn't even think to unbundle and then bundle again (which seems obvious now).