Multipage word document cannot be printed using webutil

We have the following problem. We are using Oracle Webforms 11g (11.1.1.4). On the server a Word 2010 docx document has been created and needs to be printed locally. We use webutil for this with the following code:
-- 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); -- confirmconverion (false)
client_ole2.add_arg(args, 1); -- readonly (true)
client_ole2.invoke(docs, 'open', args);
client_ole2.destroy_arglist(args);
client_ole2.invoke(app,'printout');
client_ole2.release_obj(docs);
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);
When the document to be printed consists of only one page the document is printed. When there is more than one page (hard/soft page end) the resulting document is empty. We also tried Word 2003, RTF format but nothing worked.
Extra Info:
Clients: Windows XP SP3, Office/Word 2010
Server: Forms 11.1.1.4, Windows Server 2008R2
Webutil/jacob: 1.10.1 as recommended.
What can we do to solve this?

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.
-- 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);This appears to be the syntax according to the MS docs:
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

Similar Messages

  • Printing multipage Word documents

    I am trying to automate printing multipage Word documents.  If more than 1 page, I wish to automate the duplex function.  I can't seem to get a script that works.  If anyone has one and wishes to share or could direct me, I will be grateful.  Thanks.

    The short answer is that the Java Print Service that comes with J2SE 1.4 does not contain support for MS-Word documents. I would be surprised if Sun ever offered support for anything from Microsoft. There is support for RTF some support in the J2SE for RTF (take a look at JEditorPane), which is a Microsoft standard, but that's about it. You might want to take a look at the POI project at http://jakarta.apache.org/poi/index.html There is support for working with a few Microsoft Office file formats there.

  • HP 7520 Printer; I cannot delete a word document in the print queue

    HP Envy laptop and Microsoft Windows 8 OS.  I send a word document to the HP 7520 Photosmart printer and it did not print.  It was in the print queue but would not print.  I attempted to delete it but it would not delete.  Other documents cannot be printed.

    Hi,
    From the Desktop, hold down the Windows key and press R.  Into the Run window, type s

  • Document cannot be printed, no pages selected

    Using Win 7 & Adobe XI. Trying to print pdf's created years ago. Trying to print pdf attachments received in emails. Get error message "The document cannot be printed" & "There are no pages selected to print". Have tried printing as "Image". Have tried printing to multiply printers. Have download Adobe Reader and restarted CPU. I can print Adobe test page OK. Problem started Monday Jan 26, 2015. Printed fine on Friday Jan 23, 2015. No changes in any programs or software in last 3 months other than Adobe Reader download in attempt to correct issue.
    Any suggestions
    Ichabod6957

    Try the following: open Adobe Reader | Edit | Preferences
    under Documents, change 'View documents in PDF/A mode' to Never
    under Security (Enhanced), disable Protected Mode at startup

  • An original document cannot be printed twice error

    Hi All,
    Here is the thing, I am on SAP B1 2007A PL 45. I have draft Incoming Payments. Now, I choose the Payment Drafts Report and from there, I click on the relevant payment draft to highlight it. Then I click Print to print a receipt for that payment.
    I choose my printer and then click on Print. The error message, "An original document cannot be printed twice. In the Print Preferences window, choose to print a single copy only." appears and nothing is printed.
    The problem is, I used to be able to do this in version 2005A PL 46. I am aware of note number 1262165 but this note is not relevant to me as I have not set for the receipt to be printed once added. Any solutions to this? Thanks.

    Gordon,
    I refer to the note and the problem is, for me, I have not added the document and in 2005A, I could print the receipt when I select the particular payment in the draft window. In 2007A now, I can't.
    In any case, I was referring to the temporary solution which was in the link posted by Jeyakanthan A above and I needed more explaination as to how to use the work around while I wait for a permanent solution in SAP.
    In any case, the note you were referring to has been fixed in Patch 48. I am now on Patch 49, so obviously my problem is not related to the note.
    Can someone please further elaborate on the temporary work around so that I can try it out? Based on the brief description, I did not understand how the temporary work around can help me.
    Anybody at all, if you could be kind enough to explain the work around, thank you very much.
    Regards,
    Alvin

  • How do I get my new presario lap top to scan a word document in my printer scanner

    how do I get my new presario lap top to scan a word document in my printer scanner

    You will have to load up some OCR software for optical character recognition.  Free programs are on the web, just search.
    Two I use:
    Free OCR to Word
    Free OCR
    Say thanks by clicking the Kudos Thumbs Up to the right in the post.
    If my post resolved your problem, please mark it as an Accepted Solution ...
    I worked for HP but now I'm retired!

  • It says The Document Cannot Be Printed  No Pages have been selected to print

    How come when I try to print a PDF file it takes a long time to flatten and then says "The Document Cannot Be Printed" and then "No Pages have been selected to print"

    What is your operating system?  Reader version?

  • Store and retrieve a word document in database 10g using BFILE

    Hello guys
    I want to store a word document in oracle 10g using BFILE and forms 10g. Can anyone send me a sample code?
    Thanks

    Look at
    Re: How to store a "word document" on Data Base?
    hope helps

  • I cannot print word documents but can print all other documents

    Since updating my virus checker I cannot print word documents. I can print all other documents

    At this point my suggestion is to do a full uninstall of the old print driver and an install of the most recent version print driver which you can obtain at:
    http://h10025.www1.hp.com/ewfrf/wc/softwareCategory?os=228&lc=en&cc=us&dlc=en&sw_lang=&product=40664...
    Please follow the uninstall procedure before installing the new driver.
    Regards,
    Eric
    I am an HP employee.

  • Word document won't 'print' to PDF on proper paper size

    I have a document in MS Word that's on a 5.5x8.5 page size. If I do a Save As, the resulting PDF uses the proper paper size, but it also shows color--which I don't want for this particular document.
    When I do Print and choose Adobe PDF, I can choose Black/white which is great, but I'm struggling to get it to use the right paper size. I've tried ever combination I can think of in the Default Setting and Adobe PDF Page Size options, but can't get it to show anything but 8.5x11.
    Any thoughts on how to get the right paper size using Print to PDF?

    Is this a Word document generated by Adobe's RoboHelp product or just a document generated directly in Word?
    If the latter, you are asking in the wrong place. Even if you are using RoboHelp, this looks more like a question to ask in the Acrobat forums.
    http://forums.adobe.com/community/acrobat
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Word document closes before printing

    I am using a HP Deskjet 6980. Just recently when you try to print a word document go into file, print, the document appears to go to the printer but fails to print and the document closes.  But when you click on the printer icon in the toolbar the documents prints out once.  Anyone any ideas where the problem lies.
    Many thanks
    Bob

    This is undoubtedly not the most optimal solution, but what happens if you print to PDF? Do all shapes and objects appear in the PDF electronic copy on screen? If so, how does it look, then, if you open the PDF with Adobe Acrobat (Reader?) or Preview and print hard copy from there?

  • Print an MS Word Document to specific Printer tray

    Hi
    How do I print an MS Word document to a specific tray?
    In fact it even should be a different tray per page. (First page different from the following ones...)
    If there isn't a OLE2 Procedure, is there any workaround?
    Maybe using a Macro?
    As I have been told that this isn't possible, I would be very grateful for any help :-)
    Karine
    Message was edited by:
    Karine
    Message was edited by:
    Karine

    Hi Karine,
    using ole2 isn't immediately, you must try first to write the code in a VB macro and then translate in ole2.
    in this link there are some examples
    http://www.todoexpertos.com/categorias/tecnologia-e-internet/bases-de-datos/oracle/respuestas/362078/invocar-word-desde-forms
    bye

  • How can I burn a Word document that will be used on a PC?

    Hello,
    I have to burn a Word document onto a disk for a friend who is using either PC or a Mac. It will eventually go to a publisher. I haven't burned a .doc in ages and can't remember how to do it. Do I want to use a CD-R and not a DVD-R? Also can I use Toast and choose the PC option or should I use Disk Utility? If disk utility how do I do it? I just want to make sure it will work on a PC if that is what will be used to extract it?

    IT's a non-issue, assuming you have recent versions of OSx and MS Office. Just use the Finder to burn the disc. PC Word reads Mac Word just fine, with some rare exceptions.
    -insert blank CD-R, because they are the cheapest, unless your Word doc is more than 700MB.
    -drag .doc document into the mounted, untitled CD-R icon.
    -using any of several methods (which can vary a bit depending on your OS), use the Finder to burn the CD-R. One way is to click once on the CDR icon, then go to the FInder/File menu and select Burn CD. In OSX.5.x, there are Burn commands in the window for the CDR (i.e. double click on the CDR icon for the root window).
    A window should open, asking if you want to burn this disc so that any computer (Mac or PC) can read it.
    edit: your Toast method you did while I was typing sounds like it should work, too.
    Message was edited by: louie

  • How do I sync a Word document onto my iPad, using Adobe reader?

    My laptop can't connect to the Internet, so I'm trying to upload some critical documents to my iPad, using Adobe Reader. I've tried copying them via ITunes, and while the sync is supposedly successful, they don't show up in Reader on my inPad. Any suggestions.

    You might also try to convert the word document to PDF using our Create PDF service:
    https://www.acrobat.com/createpdf/en/home.html
    or acrobat product:
    http://www.adobe.com/products/acrobat.html?promoid=JOLIR
    Further, some versions of Word support exporting PDF files directly.

  • My word documents are not printing

    Hi, my deskjet 2544 will not print word documents. It will print off the internet though.

    Hi,
    Sorry to hear you are having problems printing.
    What device/operating system are you printing from?
    "Although I work for HP, I'm speaking for myself and not on behalf of HP"
    "Say "Thanks" by clicking the Kudos Star in the post that helped you.
    --Please mark the post that solves your problem as "Accepted Solution"

Maybe you are looking for

  • The subnet mask on the Extreme isn't the same as on the Express.

    Dear Group, I have my Extreme configured to do PPPoE and DHCP and my DSL modem is setup as bridged. Everything is finally working well. I have an Express extending the Extreme in a WDS. When I look at the PPPoE tab in the Internet tab of the Extreme

  • HP Photosmart Premium C309g-m unable to print ("check printer documentation")

    My printer is:  HP Photosmart Premium C309g-m  My computer is: Mac (Mac OS X system)  After removing a jammed paper (probably the incorrect way), I now receive a message to check "printer documentation" and then press "okay".  Tried everything I coul

  • One (src)to many(target) field mapping

    Hi, I am new to XI.Is one to many field mapping possible in XI? Plz send me the links with examples.

  • Oracle Financials Applications

    Hi Friends! I do not know where to put the Oracle Apps related questions hence I am posting my question here. Pleasae bare with me. In Oracle Apps, I could not find heavily used referential integrity kind of things in the tables used by apps (as far

  • Where to download Developer patches?

    Hi, Does anyone know what the latest patch level is for Developer 6.0? Is it 6.0.5.29? Or is a later one available? Also, which URL do I access to download the patches? Thanks in advance... Massoud null