Hi,
| public class Test { |
| |
| public static void main(String[] args) { |
| |
| String progID = "MsPowerPoint"; |
| |
| Display display = new Display (); |
| Shell shell = new Shell(display); |
| |
| OleFrame clientFrame = new OleFrame(shell, SWT.CLIP_CHILDREN); |
| clientFrame.setBackground( |
| JFaceColors.getBannerBackground(clientFrame.getDisplay())); |
| |
| clientFrame.setBounds(shell.getClientArea()); |
| |
| OleAutomation auto = null; |
| try { |
| |
| |
| |
| File file = new File( |
| "F:\\shared\\Mis Articulos\\aejac\\El Futuro De Java.ppt"); |
| OleClientSite site = |
| new OleClientSite(clientFrame, SWT.NONE, file); |
| site.setBackground(JFaceColors.getBannerBackground( |
| clientFrame.getDisplay())); |
| auto = new OleAutomation(site); |
| |
| site.doVerb(OLE.OLEIVERB_SHOW); |
| |
| |
| } catch (SWTException ex) { |
| System.out.println("Unable to open type library for "+progID); |
| return; |
| } |
| |
| |
| |
| |
| shell.open(); |
| while (!shell.isDisposed ()) { |
| if (!display.readAndDispatch ()) display.sleep (); |
| } |
| |
| display.dispose (); |
| |
| } |
| } |
... geklaut von
http://jroller.com/page/mpermar/20041222#how_to_open_ms_powerpoint... nicht ganz sicher, aber ich glaube vor display.dispose() müsste evtl. noch auto.dispose() oder/und site.dispose() kommen. Bin mir aber nicht sicher.
werde dem nachgehen.
Axel