LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How does the start and end indexes in the Word Format Text VI reference to a word document?

Solved!
Go to solution

How do I correlate the start and end index values to a position or coordinate in a word document?

Is there some type of lookup table that will reference a value of say "35" (for start) to a particular character or line position in a word document? There is nothing in the LV help that explains anything but the value of "-1".

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

Hi JayB,

can you please explain a bit more? What do you try to do? Do you use ActiveX?

 

Mike

0 Kudos
Message 2 of 4
(2,766 Views)

I am using the Report Generation VIs to create a data sheet as a word document. I am using the Word Format Text VI to format the Top row of text in the document. I only want to format this row and not the entire document so I need the use the start and end indexes of this vi. I know you can use numbers to select a certain region of the document but I do not know how the numbers map/correlate to the document. The help state -1 for either one with select the entire document but I do not want to do this.

format_textVI.JPG

0 Kudos
Message 3 of 4
(2,756 Views)
Solution
Accepted by JayB

Hey JayB,

 

The Start and End values of the Word Format Text.vi are the character positions within the document. The values start at 0 on the first character(or ASCII character like a space, tab, or carriage return) and increment for each character (or ASCII character). So, for example if I wanted to bold the word "Carrots" in this the list below, where the values start at 0 on the word "Groceries"

 

Groceries:

Apples

Black Berries

Carrots

Detergent

 

Then I would enter a start of 33 and an end of 40, making sure to count the carraige returns and spaces.

 

Hope this helps.

 

Logan H

National Instruments
Applications Engineer
0 Kudos
Message 4 of 4
(2,741 Views)