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 5
(3,086 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 5
(3,075 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 5
(3,065 Views)
Solution
Accepted by topic author 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 5
(3,050 Views)

Hi Logan H,

 

I know this question is pretty old, but I have not found anything closer to what I need. I need to format the color of text in a word report. With this method I would have to track the character count of everything entered via bookmarks then shift based on where in the template I would like to format the text. Is there a way to index off of a bookmark to figure out your starting index to format the text of the bookmark?

 

V/r,

 

Matt

0 Kudos
Message 5 of 5
(190 Views)