LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Number of pages in Word report

Hello all,
 
I want to create a Word report from Labview and include the total number of pages in the footer.
The 'Word Set Page Numbering.vi' has a boolean input for this option. On my PC this results in a error.
 
Can anyone try this or does someone know the solution for this.
 
(I know I can use a template to solve this)
0 Kudos
Message 1 of 7
(3,989 Views)

Hi KC,

I've never seen this VI return an error before.  What version of LabVIEW, Office, and the Report Generation Toolkit are you using?  Also, can you attach a simple VI that demonstrates the behavior?  What is the specific error you receive?

Let me know,

-D

P.S. - I just thought of something...I believe you need to have a printer configured in order to set header/footer information.  Does your computer have a printer configured?

0 Kudos
Message 2 of 7
(3,980 Views)

Hi Darren,

Thanks for the reply.

Yes, I have a printer configured on my PC. I'm using LV8 and office XP

Tomorrow when I am back at the office I will try the VI with LV7.1 and inform you about results and versions.

0 Kudos
Message 3 of 7
(3,975 Views)

Hi KC,

I just thought of something else...are you using a foreign language version of Office and/or Windows?  If so, is it a language other than English, French, German, or Japanese?  If so, you will need to go into vi.lib\addons\_office\word.llb\Word_auto_text_language.vi and make an edit to the VI.  Specifically, you will need to add your language's translation of "Page X of Y" into the string array indexing the While Loop, and you'll need to change the '3' constant inside the loop to a '4'.  To figure out the specific translation, go to word, and in the menus, choose Format > AutoFormat... > Options... > AutoText.  Scroll the list and find your language's translation of "Page X of Y", and enter that identically in the string array...the case and spacing are sensitive, so make sure it matches exactly.

Of course, if you're not using a foreign language version of Office, then all this information will be helpful to somebody else searching the forums someday.  🙂

Keep me posted, and make sure to indicate the specific error you're getting in your next post (for my benefit, and for the benefit of future users searching the forums).

-D

Message Edited by Darren on 01-24-2006 11:54 AM

0 Kudos
Message 4 of 7
(3,965 Views)

Hi Darren,

You're right the error is comming fron the Word_auto_text_language.vi  But to avoid these kind of problems we are always using english software.

The problem is that in the office installation I have the Autotext is changed  Smiley Surprised   The 'Header and Footer' part is not present. So the 'Page X of Y' autotext is also not present and I cannot add this because the ALT-F3 button is grayed out.

I asked for a reinstall, see how it works then and let you know.

 

The error message I got:

Exception occured in Microsoft Word: The requested member of the collection does not exist.Help Path is C:\Program Files\Microsoft Office\Office10\1033\wdmain10.chm and context 25421 in Word_auto_text_language.vi->Word_auto_text_entry (for page number).vi->Word Set Page Numbering.vi->Page numbers.vi

With number: -2146822347

 

Message Edited by K C on 01-25-2006 01:25 PM

Message Edited by K C on 01-25-2006 01:25 PM

0 Kudos
Message 5 of 7
(3,952 Views)

Hi KC,

Yes, that would definitely cause a problem if "Page X of Y" is not present in the Autotext entries list.  I hope the Office repair/reinstall fixes your problem.  Note that this is a limitation of the ActiveX interface to Word...if you want page numbers in the form of "Page X of Y", the *only* way to accomplish this through ActiveX is to use the AutoText feature.

Good luck,

-D

0 Kudos
Message 6 of 7
(3,943 Views)

Hi Darren,

It's working now.Smiley Very Happy   But a remove and reinstall didn't do the trick.

It was one of the settings in the normal.dot file. Just remove the normal.dot file and the autotext items are back again (Word creates a new normal.dot file)

Thanks for your support

 

Message Edited by K C on 01-26-2006 10:28 AM

0 Kudos
Message 7 of 7
(3,933 Views)