LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I print some pages from multipage report

Hello,

I have created a multipage report in word. I would like the user to be able to print the pages selected (as in word printing: pages: 1, 2-3);

I am using Office 2007 pro, the LabVIEW Report Gen Toolkit, LabVIEW 2009, and Windows XP.

 

I used the suggestion in thread:

http://forums.ni.com/t5/LabVIEW/How-can-you-print-a-single-page-of-a-multipage-report/m-p/155233 , modifying the print VI that comes shipped with LabVIEW: NI_ReportGenerationToolkit.lvlib:Word_Print.VI.

 

first of all I put two integer constants on "From" and "To" in the Invoke node (PrintOut), but Labview return an error:

 

Error 1015 occurred at NI_ReportGenerationToolkit.lvlib:Word_Print.vi -> NI_Word.lvclass:Print Report.vi -> print2.vi


Then I searched for PrintOut Method in word 2007 Reference guide, and I saw that for using From and To the Range field must have the string  wdPrintFromTo;

I insert wdPrintFromTo string  in RANGE Field and tryed.... same error...... Smiley Sad

After that I change approach; removed all constants and used the field Pages; I put a string "1-2" connected to this field and now the printer respond, but all pages was printed!

 

What's wrong?

 

many thanks

 

 

 

 

 

Download All
0 Kudos
Message 1 of 3
(2,296 Views)
0 Kudos
Message 2 of 3
(2,279 Views)

Thanks, Alex!

ok, I try first approach in print4.vi, but Labview return an error (view jpg); if I cut From, To controls, the VI print all pages. The same things happen also if I trasform I32 in Variant.

 

I don't try second approach, because at this time I have only one report

 

I try also with VB macro: this is better (print3.vi) but.....if I use:

Sub Print_Pages_From_To()
ActiveDocument.ActiveWindow.PrintOut Range:=wdPrintFromTo, From:="2", To:="3"
End Sub

is ok; print the pages selected; if I use:

Sub PrintPages()
ActiveDocument.ActiveWindow.PrintOut  Pages:="2-3"  
End Sub

printer print all pages.

 

what do you think?

 

regards,

Italo

 

Download All
0 Kudos
Message 3 of 3
(2,258 Views)