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: 

Reading bookmarks-values from word-documents with identical bookmark-start and end

Hello,
 
I am using the attached vi (labview 2013) for reading bookmark-values from a word-doc but because the beginning and the end-position of the bookmark-value is at the same position so it returns an empty value.
The size of the value is 4 characters. Is there a way to control the length of the bookmark-value which will be read regardless of the end and start-position of the bookmark? 
Thank you and best regards.

0 Kudos
Message 1 of 4
(2,262 Views)

I haven't tried this to see if it works but get the start of the range at the bookmark, create a new range specifying the start and end (which equals start+4) and then use the range.text command to get the value. 

2018-07-24_13-55-17.png

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 2 of 4
(2,243 Views)

Hi aputman,

 

Thank you for the solution. It Is working but only at the second run of the program.

The first run changes the bookmarks at the original document to the new width. The second run of the program then reads the correct value. Just to let you know. I hoped that my original document was not touched and stayed the same but of cause it is not such a big issue.

 

Regards.

0 Kudos
Message 3 of 4
(2,240 Views)

Sorry for the delay in getting back to you.

This should work.  Rather than modifying the range object, this uses the bookmark range to make a document range that can be selected.  Be sure to close all references (which I have not done here).

2018-07-25_10-03-16.png

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 4 of 4
(2,213 Views)