[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Embedding Word or Excelsheet documents in SWT shell

I was trying to embed a word document or an MS Excelsheet into a dialog but
could not do that. Is it not possible to do that ?
The following code that I tried opened the word document or excelsheet in 
MS Word or MS Excel respectively and the dialog was empty.
I tried, with no success, the different constants in OLE class as a parameter in
the doVerb method.

Chandresh

Code ::

public static void main(String[] args) {
        Display display = new Display();
        Shell shell = new Shell(display);
        OleFrame frame = new OleFrame(shell, SWT.NONE);
        File file = new File("D:\\junk.doc");//downloads\\Expense 
Accounts.xls");
        OleClientSite clientSite = new OleClientSite(frame, SWT.NONE, file);
        clientSite.doVerb(OLE.OLEIVERB_PRIMARY);

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