Opening multiple VSTO enabled WordML docs

Hi,

I am creating wordml files in managed code, attach my VSTO solution using ServerDocument, and open them using Process.Start ("myWordMLFile.xml").

The odd thing is that if word is already open, the wordml file is not opened. Process.Start seems to work fine, because MSOXMLED.exe shows up for a second in the processes, but the file is never opened. When there is no word process running, everything works fine.

Does anybody know a solution *without* starting "winword.exe" with the filename as argument This app will be widely deployed and I don't want to mess around with the different installation paths of word on the machines.

TIA,




Answer this question

Opening multiple VSTO enabled WordML docs

  • npocmu

    Hi,

    By default open a wordml document causes word to show up, regardless of any other opened instances of word already in memory.

    If your machine has the correct file type configured, this line of code should produce the effect that you're looking for.

    System.Diagnostics.Process.Start(@"D:\temp\doc1.xml");

    File types manual verification:

    create a wordml document (ie: c:\temp\doc1.xml)
    launch word
    open a command prompt session (cmd.exe)
    type "start c:\temp\doc1.xml"

    How to fix the file types:

    Control panel, folder options, File Types tab
    look for the extension DOCXML
    hit default button to restore the (Office setup) standand behavior



  • Newbie10

    Hi Mario,

    thanks for your reply.

    I tested the behavior the way you told me and could reproduce the behavior of process.start in the commandline.

    I created two wordml files and tried to open them subsequently:
    C:\>start c:\test1.xml
    C:\>start c:\test2.xml

    => test1.xml does open, but only test2.xml does not!

    Does this work on your system

    My Dev-Machine is a Windows Server 2003 Enterprise Edition.
    Folder options for "DOCXML" are set to the following:
    Only one action "&Edit" which is the default.
    Application used to perform the action: "C:\Program Files (x86)\Microsoft Office\OFFICE11\WINWORD.EXE"
    Use DDE: checked
    Application: WINWORD
    Topic: System

    Folder options for "XML" are set as following:
    Action "open" is default.
    Application used to perform the action: "C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE11\MSOXMLED.EXE" /verb open "%1"
    Use DDE: checked
    Application: MSOXMLED
    Topic: System

    Best regards,



  • Obtek

    Hi Ernest,

    yes, on my machine (Xp32bit) it does work as I have described in my original post and the settings

    you reported are the same I have on my box.

    But I noticed that your path is slightly different from mine C:\Program Files (x86)\Common ...

    instead of the usual C:\Program Files\Common --

    so, I'm gussing you're using a 64bit OS. Is that correct

    If this is the case, remember that on win64bit there are 2 registry db (32bit and 64bit) and

    several duplicate subsystems.

    I'm assuming you have used the default command prompt (x64bit) which does not lookup in the same

    registry hive that XP and Office32bit does.

    try this: type %windir%\SysWoW64\cmd.exe   and then try one more time my original instructions.

    for some extra details about the differences between x64 and x32 OS for devs please take a look at this link

    mario



  • Opening multiple VSTO enabled WordML docs