I use eclipse swt in my application. It allows me open word files (doc, docx, rtf).
But I cannot hide "Confirm Conversion at Open" dialog programmaticaly when open docx file (doc or rtf open fine). Windows XP SP3, Microsoft Word 2003 SP3 and FileFormatConverters installed on machine. In VBA this dialog hides when set property Application.Options.ConfirmConversions = false. Or sets property when open file:

    Documents.Open FileName:="file_path_name", ConfirmConversions = false. 

I set this property with help OleAutomation, but this doesn't work. Bellow part of code that I use:

    shell = SWT_AWT.new_Shell(SwtHelper.display, canvas);
    shell.setLayout(new FillLayout());
    try {
        frame = new OleFrame(shell, SWT.NONE);
        clientSite = new OleClientSite(frame, SWT.NONE, "Word.Document", file);
        clientSite.doVerb(OLE.OLEIVERB_SHOW);
    } catch (SWTException e) {}

This code work fine
How I can hide Confirm Conversion dialog when open docx using swt and word 2003? Thanks.

没有正确的解决方案

其他提示

You should try Word.Application instead of Word.Document. There is huge difference whether you use Word.Document or Word.Application.

Word.Application will let you pass arguments to ole.

Please have a look at my comment given here: https://stackoverflow.com/a/17021512/1285811

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top