문제

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