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: 

Word Format Paragraph (adv) VI indexes

Hi,

 

I'm trying to use the Word Format Paragraph (adv) VI to centre the title of a report, and then again to left justify the text that follows it.

 

I can see in the help file (http://zone.ni.com/reference/en-XX/help/370274E-01/lvoffice/word_format_para_adv/) that I need to specify 'Start' and 'End' constants to do this, but it's not clear to me how the indexes correspond to the document. In my example (attached) I have chosen start=0 and end=1 for the first paragraph and start=1 and end=2 for the second paragraph but this was a bit of a wild guess and the result is not what I need.

 

Can anyone shed some light on this for me please?

 

Many thanks,

 

Ian

0 Kudos
Message 1 of 3
(2,398 Views)

Hi Ian,

 

Its easiest if you do the formatting at the end of the document. I've attached a modified VI that does what I think you're looking to achieve. If you run it as is, the only thing that will change is the title centre aligned, but note that the graph is also centre aligned by default. If you reverse the cases of the diagram disable structure, it'll first apply the default formatting to the whole document, single spacing everything and aligning everything to the left (excluding the header/footer).

Regards,


Imtiaz Chowdhury
Project Manager
Green Running / Austin Consultants

0 Kudos
Message 2 of 3
(2,379 Views)

Hi Imtiaz,

 

Thanks for that - the modifications you made give me the result that I wanted.

 

I also found another way to do it which I will probably end up using when I implement my project "for real" (this was a bit of an experiment).

In the NI example finder there is an example called "Run Macro on Word Table.vi" which I could adapt for my purposes. I think this method would clear up my block diagram a lot by just having a couple of blocks for importing the data into Word, and then the module code for a Macro that I record in Word that can do all the complex formatting in one go.

 

Thanks again for your assistance,

 

Ian

Message 3 of 3
(2,368 Views)