我已经通过以下代码从Java中打开了Visio..
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("Visio Example");
shell.setLayout(new FillLayout());
try {
OleFrame frame = new OleFrame(shell, SWT.NONE);
new OleClientSite(frame, SWT.NONE, "Visio.drawing");
} catch (SWTError e) {
System.out.println("Unable to open activeX control");
display.dispose();
return;
}
shell.setSize(800, 600);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
现在的问题是,只有在手动点击“OK”后才会打开一个页面。
我想直接跳转到新页面进行绘制,需要对我的代码进行哪些改进?
这也可以在图片中看到。
谢谢。