From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bookmarks are deleted while generating MS word report from template.

Solved!
Go to solution

 

Edited:

@aputman: I tried restricting the doc/template editing to form fill only but no help... 😞


That's strange, I tried it and it worked fine.

 

Ben64

0 Kudos
Message 11 of 23
(1,567 Views)

If I run this code, it works without error.  Not sure what your issue is now.  

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 12 of 23
(1,562 Views)

PLease follow following steps:

a. Run the code. Create and save a file (with data populated in the file).

b. now modifiy the code to open the file you just created (and not the template) and now run the code.

 

The intent of second step is, open an already created file and change/overwrite the data in it. However this time you'll see an error (-41110).

0 Kudos
Message 13 of 23
(1,559 Views)

James code works well, it does the same thing as specified here.

 

Ben64

Message 14 of 23
(1,543 Views)

I'm pretty sure my idea is what OP wants. Here, I edited his code to just the basic bookmark insertion code and it runs as I believe he wants.

Report Generation.png

 

Edit: Thanks ben64

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 15 of 23
(1,538 Views)

Another (better....maybe) solution would be to not have text as part of the bookmark.  If you highlight text and Insert -> Bookmark, the text becomes the bookmark and is deleted when text is appended at this location.  If you place the cursor at a location and insert the bookmark (with no text selected), it doesn't disappear when the text is appended via Labview code.  This doesn't require any additional code to reinsert the bookmark.  

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 16 of 23
(1,530 Views)

Sorry James.  I read the OP's explanation that fields were being used and I assumed they were talking about form fields.  

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 17 of 23
(1,529 Views)
One disadvantage of using a bookmark as a single point instead of a range, is you would need to figure out what text is next to the bookmark in order to replace that text with a different value. Otherwise, you would have every value just appending with the previous values each time.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 18 of 23
(1,523 Views)

@James.M wrote:
One disadvantage of using a bookmark as a single point instead of a range, is you would need to figure out what text is next to the bookmark in order to replace that text with a different value. Otherwise, you would have every value just appending with the previous values each time.

Good point.  Form fields to the rescue.  (or just do what James did Smiley Wink)

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 19 of 23
(1,512 Views)

Thank you all so much.

 

I hope, I'll be able to use James code... I'll try it tomorrow...

Requesting James to save the code in version 2013...

0 Kudos
Message 20 of 23
(1,511 Views)