LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Report Generation Tools

I am trying to use the Report Generation Toolkit to write to a MS Word document using bookmarks with a Word Template file. I cannot figure out why I am getting an error when the vi runs concerning being able to write to the report file.

0 Kudos
Message 1 of 5
(142 Views)

I found a hint here:

https://stackoverflow.com/questions/26731527/word-automation-late-binding-replace-bookmark-returns-t...

 

There's a different scope to replace a bookmark inside a form field. I was able to make your example work by deleting the form field and adding a normal bookmark.

 

If you have to keep the form fields, there should be ActiveX calls to work with them, instead of using the Report Generation Toolkit.

0 Kudos
Message 2 of 5
(126 Views)

Jeremy,

Thats great you got it to work but can you be more specific about how to delete the form field and adding a normal bookmark?

0 Kudos
Message 3 of 5
(118 Views)

If you right click -> properties on the field you can see that the bookmark is assigned inside the field:

JeremyPeterson_1-1736778563735.pngJeremyPeterson_2-1736778584146.png

 

The problem is that the Report Generation Kit VIs can't access the bookmark inside the field -- it's in a different scope.

 

So first you can delete the form field to get rid of the embedded bookmark. (You could also clear the bookmark from the field by clearing the textbox shown above, but this leaves a useless field behind in the template.)

JeremyPeterson_3-1736778744132.png

 

Re-add the bookmark with the same name at the same place by selecting Insert -> Bookmark:

JeremyPeterson_4-1736778840094.png

0 Kudos
Message 4 of 5
(62 Views)

Thank you! It works perfectly now.

0 Kudos
Message 5 of 5
(49 Views)