Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] ActiveX - printing a word document


Hi All,

I'm trying to send a Word document the Print command, however, it seems that this function is disabled?
Here's my code:

        public static void main(String[] args) {
                Display display = new Display();
                Shell shell = new Shell(display, SWT.TITLE | SWT.CLOSE);
                shell.setLayout(new FillLayout());

                OleFrame frame = new OleFrame(shell, SWT.NONE);
                OleClientSite clientSite = new OleClientSite(frame, SWT.NONE, "Word.Document");
                clientSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);

                shell.layout();
                shell.open();

                Variant vIn = new Variant();
                Variant vOut = new Variant();
                clientSite.exec(OLE.OLECMDID_PRINT, OLE.OLECMDEXECOPT_PROMPTUSER, vIn, vOut);

                while (!shell.isDisposed()) {
                        if (!display.readAndDispatch())
                                display.sleep();
                }




Cheers,
--
Sharon Dagan
IT Architect, Software Group
IBM Israel    

e: sharon_dagan@xxxxxxxxxx
p: +972-3-9188776 m: +972-52-554776

Back to the top