03-05-2012 01:35 PM - edited 03-05-2012 01:37 PM
The example code they list on the first website I pointed you too looks like this: .ActiveDocument.PrintOut(0,0,"3","","4","8")
I'm wondering if windows needs a blank string varaible to be written to the outputfile name property in order for everything to function properly.
From the prototype it looks like for range set to 3 you'll need integers for the background and append properties. Then strings for range, outputfile name (blank string), from, and to.
It appears you can leave the rest of the properties blank. Try setting it up that way and see what happens.
03-05-2012 01:54 PM
Hi Zach,
By "blank string" do you mean an empty string contstant?
I've tried all that to no avail.
I have attached my file once more.
Regards,
Chris
03-05-2012 03:20 PM
I'm able to get it working in word 2007 when I have it set up like below.
03-05-2012 03:43 PM
Now with the empty char constant on the OutPutFileName, it wants to save to a .prn file.
I disconnected the empty char constant.
I am unable to shut off the print to file.
I have closed the program without saving and reopened it. No change.
I closed and reopened LabView 2010. No change.
Previously it was printing to my default network printer.
???
Thanks,
Chris
03-05-2012 04:02 PM
Got it going to the printer once again. I entered quotes "" into the char constant.
The rest of the problems persist.
0 Can only print all pages.
1 prints a blank page
2,3,4, print nothing, however something (looks like zero pages) is sent to the printer per a network reply.
Chris
03-05-2012 04:15 PM
Zach,
Are you using LV2010 or LV2011?
I only have LV2010 loaded on my machine. I have not yet installed 2011.
Maybe I need to use 2011?
Can you try the .vi in V2010?
Thanks,
Chris
03-05-2012 04:17 PM
Even when you wire it exactly as I did? (except with your added quotations) In the VI you sent me you had pages and to from wired in. It may not accept that, try just having one or the other.
It makes sense that two doesn't do anything. You don't have a current page up in word.
Also try watching the VI with highlight execution on. It will throw an error if you don't have the properties configured correctly.
03-05-2012 04:22 PM
I was originally using 2011 SP1, but I can verify that it works on 2010 as well. I am using word 2007 though not 2010.
03-05-2012 05:01 PM
It certainly does throw an error if one if the inputs is in the wrong format. Seen that many times.
So I'm guessing you don't have Word 2010 available?
Let me know about LV2010 operation.
Thanks,
Chris
I may go ahead and install 2011 and try again.
However, as I recall, installing 2011 blew out something and I had to uninstall 2011, 2010 and reinstall 2010. Not so good.I may not want to try this.
03-05-2012 05:47 PM
No I don't have ready access to it, we're currently running on MS Office 2007. As I said previously, this VI works in 2010.
The problem is likely related to the format of the ActiveX call not LabVIEW. That's further reinforced by the fact that you're continually throwing errors.