none
select which instance to use when opening an attachment in Outlook RRS feed

  • Question

  • Hi,

    I'm looking for a way in Outlook to select which existing instance of a program will be used to open a given attachment. I've been told this functionality exists (or existed in the past), but I can't find any reference on this feature. I think this can be achieved through WIN32 API (looking into the process catalog, etc) but I was wondering if there was some ressources to look for in VSTO.

    Thx


    Thursday, July 28, 2016 11:37 PM

Answers

  • Outlook simply executes the open verb associated with the given file extension (as specified in the registry). If that program upon startup transfers control to another instance of itself, Outlook does not know or care to the best of my knowledge.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Friday, July 29, 2016 2:32 AM
  • Hello Jean-Mathieu,

    As Dmitry wrote, Outlook doesn't care what application is opened for attachments. The default one set on the system is used in Windows. To set such application (or associate an extension with the application) you need to add some Windows registry keys. Follow these steps to create a your own association:

    1. Open HKEY_CLASSES_ROOT and create a key for extension (if it doesn't exist)
    2. Open that key and write into DefaultValue name of your "handler" - somthing like MyApp_ext
    3. Close current key and create another key inside HKEY_CLASSES_ROOT with the name of your handler (MyApp_ext)
    4. Open that key and write into DefaultValue description of this extension.
    5. Create a key DefaultIcon inside the handler key.
    6. Open that key and write into DefaultValue full path to the file containing an icon.
    7. Close the current key and create \shell\Open\Command keys inside the handler key
    8. Open that key and write into DefaultValue full path to your application including parameter.

    If you face troubles creating the file extension association, open a regedit and take a look at the structure inside HKEY_CLASSES_ROOT key. Read more about that in the What registry keys are responsible for file extension association? forum thread.


    [custom.development]

    Monday, August 1, 2016 6:04 PM

All replies

  • Outlook simply executes the open verb associated with the given file extension (as specified in the registry). If that program upon startup transfers control to another instance of itself, Outlook does not know or care to the best of my knowledge.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Friday, July 29, 2016 2:32 AM
  • Hello Jean-Mathieu,

    As Dmitry wrote, Outlook doesn't care what application is opened for attachments. The default one set on the system is used in Windows. To set such application (or associate an extension with the application) you need to add some Windows registry keys. Follow these steps to create a your own association:

    1. Open HKEY_CLASSES_ROOT and create a key for extension (if it doesn't exist)
    2. Open that key and write into DefaultValue name of your "handler" - somthing like MyApp_ext
    3. Close current key and create another key inside HKEY_CLASSES_ROOT with the name of your handler (MyApp_ext)
    4. Open that key and write into DefaultValue description of this extension.
    5. Create a key DefaultIcon inside the handler key.
    6. Open that key and write into DefaultValue full path to the file containing an icon.
    7. Close the current key and create \shell\Open\Command keys inside the handler key
    8. Open that key and write into DefaultValue full path to your application including parameter.

    If you face troubles creating the file extension association, open a regedit and take a look at the structure inside HKEY_CLASSES_ROOT key. Read more about that in the What registry keys are responsible for file extension association? forum thread.


    [custom.development]

    Monday, August 1, 2016 6:04 PM