OleClientSite ole = null;
Variant vIn = null;
Variant vOut = null;
OleFrame frame = null;
Shell shell = new Shell(Display.getCurrent());
frame = new OleFrame(shell, SWT.NULL);
try {
if (quantidadeCopias > 1) {
DialogQuantidadeCopias dqc = new DialogQuantidadeCopias(shell,
SWT.APPLICATION_MODAL);
dqc.setQuantidade(quantidadeCopias);
dqc.open();
}
ole = new OleClientSite(frame, SWT.APPLICATION_MODAL, arquivoImpressoFile);
ole.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
vIn = new Variant();
vOut = new Variant();
ole.exec(OLE.OLECMDID_PRINT, OLE.OLECMDEXECOPT_PROMPTUSER, vIn,
vOut);
frame.dispose();
ole.dispose();
shell.dispose();
ole = null;
} catch (final Exception e) {
MessageBox mb = new MessageBox(shell);
mb.setText("Error - "+e.toString());
mb.setMessage(e.getMessage());
mb.open();
e.printStackTrace();
}
}
desde já, obrigado :D