Home > Back-end >  In Java using Jacob called WPS 2002 print interface parameter Settings
In Java using Jacob called WPS 2002 print interface parameter Settings

Time:09-15

How to use in Java called Jacob WPS 2002 range parameter in the print file?

The code is as follows:

 
String filePath="c: \ test. The WPS";
ActiveXComponent WPS=new ActiveXComponent (" WPS. Application ");
The document=WPS. GetProperty (" Documents "). The toDispatch ();
Docx=Dispatch. Call (document, "Open", filePath.) toDispatch ();
Dispatch. CallN (docx, printOut,
The new Object [] {
The Variant VT_MISSING,//Background?
The Variant VT_MISSING,//Append?
The new Variant (2),//Range?
The new Variant (1),//the From?
The new Variant (2),//To?
});


Above is not successful version, according to the official version, this version of the interface should be Kingsoft WPS oleobject 1.0, wps2002 2003 falls within the scope of the interface,

And the new, is "KWPS. Application" for the name of the WPS on 2019, with the following code can be successful to print a certain range,

 
Dispatch. CallN (docx, printOut,
The new Object [] {
The Variant VT_MISSING,
The Variant VT_MISSING,
"1-2"
});


How to use the old version to specify the scope of its printed page?
  • Related