MIME Types, MS Word and DDE...

Quoting Sebastian ?urek <sebzur@gmail.com>:

Hi,

  I've met a serious problem... I've got a very simple file manager in my
application. I need to open the files with command returned by the
GetOpenCommand method, namely:

def OpenFile(self,name,ext):
    ft= wx.TheMimeTypesManager.GetFileTypeFromExtension(ext)
    filename = name + "." + ext
    mime = ft.GetMimeType() or ""
    fullpath=os.path.join(self.path,filename)
    cmd = ft.GetOpenCommand(fullpath, mime)
    subprocess.Popen(cmd,shell=True)

But... There's a problem with WinWord - the command returned by
GetOpenCommand starts with WX_DDE and the WinWord uses a DDE to load a
file. This is a source of my problem. Will I have to use something like
win32com to handle this, or maybe there's some solution within wx.DDE*
classes? I'm quite a newbie to the 'dde' (in fact, that's my very first
time with it) and I'm not sure how to handle this... And does the
WX_DDE# prefix inform me, that I shoud use some 'dde techniques' to open
the file?

IIRC, wx.Execute should recognize the WX_DDE prefix and do the right thing.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!