This content has been marked as final. Show 5 replies
We had a similar issue. I don't think you can solve this (except for splitting the document in multiple docs). It has actually nothing to do with webutil or Forms. It is a limitation of OLE2.
Why not transfer the file to the client and print it with a client_host command?
You may want to look at this. It would appear that you need to define "Range".
I have not personally tried this, but it might be helpful.
Ok... I went back and tested your code and by adding a "0" for the Range param, all pages of my 3 page doc printed.1 person found this helpful
This appears to be the syntax according to the MS docs:
-- create a new document app := client_ole2.create_obj('word.application'); client_ole2.set_property(app, 'visible', 0); docs := client_ole2.get_obj_property(app, 'documents'); args := client_ole2.create_arglist; client_ole2.add_arg(args, p_filename); client_ole2.add_arg(args, 0); -- confirm converion (false) client_ole2.add_arg(args, 1); -- readonly (true) client_ole2.invoke(docs, 'open', args); client_ole2.destroy_arglist(args); -- CHANGES BEGIN HERE args := client_ole2.create_arglist; client_ole2.add_arg(args, 0); -- 0 means background printing client_ole2.add_arg(args, 0); -- 0 means no append client_ole2.add_arg(args, 0); -- 0 means print all pages client_ole2.invoke(app,'printout',args); client_ole2.release_obj(docs); client_ole2.destroy_arglist(args); -- CHANGES END HERE args := client_ole2.create_arglist; client_ole2.add_arg(args, 0); client_ole2.invoke(app,'quit', args); client_ole2.destroy_arglist(args); client_ole2.release_obj(app);
PrintOut([Background], [Append], [Range], [OutputFileName], [From], [To], [Item], [Copies], [Pages], [PageType], [PrintToFile], [Collate], [FileName], [ActivePrinterMacGX], [ManualDuplexPrint], [PrintZoomColumn], [PrintZoomRow], [PrintZoomPaperWidth], [PrintZoomPaperHeight])
Edited by: Michael Ferrante on Oct 12, 2011 3:48 PM
We could do that but run the risk, as a lot of people are printing documents, the documents are also split up when printed. So every user has to gather his parts of the document afterwards.
I tried something else. I removed the quiting part for a moment. Then it printed ok. So it is a timing problem. The document was quited before the printing ended. Together with the suggestions for addional parameter settings for the printout I was able to fix it. In my case the printing was done in the background. I changed this so the printing is not in the background anymore. The quiting is processed after the printing is done. The downside is a printing popup appears on the screen but this is a word feature. Perhaps I can swith this off also?