1

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.

Ptr
  • 11
  • 2
  • "Doesn't work" isn't an error description. Please tell us exactly what is happening. – Daniel Hilgarth Feb 19 '13 at 13:44
  • Confirm dialog opens and opens empty word window when open docx using swt and word 2003. Exceptions or errors is nothing at the moment. – Ptr Feb 19 '13 at 14:06
  • Application.Options.ConfirmConversions is global porperty of word. I set this property to false, but this is no effect. I thing swt doesn't use this property – Ptr Feb 19 '13 at 14:13

1 Answers1

0

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

Community
  • 1
  • 1
norbi771
  • 814
  • 2
  • 12
  • 29