02-09-2012 07:12 PM
How can I print a Word document using ActiveX?
I can get a document to open and close. Can't find a way to make it print. I think I looked through and tried all the possible properties and methods, however I may have missed the one I need.
I would prefer not opening the document if that is possible.
Please point me in to the right property. Example?
Thanks,
Chris
Solved! Go to Solution.
02-09-2012 07:23 PM
02-09-2012 07:34 PM
Thanks but I was looking for something a little less canned that I could modify to print specific pages from the file.
Can you help with that?
Thanks much.
Chris
02-10-2012 03:08 AM
hi chris,
try this. I have not connected all required inputs , but I guess it could be a start point for you.
02-15-2012 12:56 PM
Thank you for your help.
I'm Almost there. I can now print, however I cannot select the desired pages from my document. The entire document prints out.
Neither the Pages input, nor the From/To inputs affect which pages are printed.
I can select the number of copies.
See the attached vi.
Can you point me in the right direction?
Thanks again.
Chris
02-16-2012 03:47 PM
It looks like you need to set the right input into the range parameter to use the from/to inputs.
The Range parameter accepts five valid values. Therefore, unless the Range parameter is correctly set, Word will not print. The valid Range values are listed below with a description of the their action:
0 Prints the entire document
1 Prints the selection
2 Prints the current page
3 Prints the range of pages specified by the From and To parameters
4 Prints the range of pages specified by Pages parameter
My guess is that LabVIEW defaults to 0 if you don't set the rang. I found this at the following link: http://support.microsoft.com/kb/176069
03-02-2012 04:13 PM
Thanks Zach for the additional information.
The problem is not yet solved.
0 - prints the entire document
1 - prints a blank page
2 - prints page 1
3 - nothing prints, I have the From To parameters entered.
4 - nothing prints. I have the Range parameter entered.
I'm using Word 2010. maybe there has been a change and this stuff no longer works?? Hope not.
My .vi is attached.
Anyone have a solution for this?
Thanks,
Chris
03-02-2012 05:35 PM
@CDreike1 wrote:
Thanks Zach for the additional information.
The problem is not yet solved.
0 - prints the entire document
1 - prints a blank page
2 - prints page 1
3 - nothing prints, I have the From To parameters entered.
4 - nothing prints. I have the Range parameter entered.
I'm using Word 2010. maybe there has been a change and this stuff no longer works?? Hope not.
My .vi is attached.
Anyone have a solution for this?
Thanks,
Chris
When in doubt, always read the Microsoft documentation because that is what you need to understand to get the ActiveX working.
http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.wdprintoutrange.aspx#Y0
03-05-2012 11:08 AM
It does look like the page I linked only mentions 95, 97, and 2003. nyc's link looks pretty promising. Were you able to implement any of those functions?
03-05-2012 12:26 PM
Thanks Zach.
No I have not yet resolved this problem. I checked on that link from nyc, however that is just too cryptic for me. I'm not a C# programmer, however, it does appear that the functions I need are in Word 2010. Maybe LabView 2010 cannot access the features in Word 2010. Would it change if I moved to LabView 2011? That presents a problem in that I am using some other hardware that has not yet had its drivers updated to 2011. maybe I can induce the supplier to update the drivers.
I am getting close to the point where I really need this to work for me.
What more can you do to help?
Thanks,
Chris Dreike