none
How to invoke built-in commands with custom options? RRS feed

  • Question

  • Hi!

    I want to invoke the built-in save as command with different options.

    Background: the built-in save as button opens a save file dialog. In this dialog a predefined directory should be selected. I have built a custom save as button in the backstage view which emulates the built-in save as button such the directory in which the item should be saved is preselected. So far so good.

    The goal is that the custom save as button should behave exactly like the built-in save as button. Depending on the type of the selected item which is going to be saved the save file dialog is looking different (different file types, different tools on the dialog, etc.) for different types. Emulating all the possibilities is difficult. The custom save as button should just send the directory to the built-in save as command.

    I couldn't find a way to invoke a comand other than the Execute method on the CommandBarControl. This method does not take any parameters so I can't pass a directory to the command control. Is there a way to invoke built-in commands with custom parameters?

    Yavuz

    Wednesday, April 4, 2012 9:51 PM

Answers

  • Can't do that.

    Why not use the standard File Save common Windows dialog? You should be able to specify the initilal directory and all the options.


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

    • Marked as answer by Yavuz T Thursday, April 5, 2012 8:26 AM
    Wednesday, April 4, 2012 10:16 PM

All replies

  • Can't do that.

    Why not use the standard File Save common Windows dialog? You should be able to specify the initilal directory and all the options.


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

    • Marked as answer by Yavuz T Thursday, April 5, 2012 8:26 AM
    Wednesday, April 4, 2012 10:16 PM
  • Because I don't want to write code to save an email, an appointment, a contact, a task and all the other stuff while giving the user the same experience like the built-in experience. That's too much work. If you look carefully you should see that the save dialog looks different when you save different items. Suppose the built-in save as dialog changes with a later version of Outlook. To keep the same experience I have to write code again. It would be fine if I could just invoke that save command passing a directory to it.

    Thanks, anyway.

    Thursday, April 5, 2012 8:25 AM