none
document library view in Office's Open file dialog - custom dialogs for outlook RRS feed

  • Question

  • Hi, I am trying to create some custom file dialogs for outlook, such that I can easily attach files from sharepoint and save email messages to sharepoint using a file dialog like interface launched from a custom outlook ribbon.

     

    (I know that there are other ways of getting sharepoint/outlook/exchange to talk.. but the dialog route is the one that we need/want)

     

    Creating the ribbon addin functionality is all fine.

     

    However it seems that unlike word, excel and powerpoint, outlook doesn't have a nice set of built in dialog boxes that are easily accessible (unless i haven't found it?).

     

    I have tried using the standard winforms dialog - but I can't set the initial directory as a sharpoint document library in this case (and this is a mandatory requirement).

     

    So we have started building our own simple dialog using a browser pane and the sharepoint dialog functionality

    http://msdn2.microsoft.com/en-us/library/ms414166.aspx

     

    However for some reason at the moment, this dialog doesn't allow us to navigate folders (the click events don't work).

     

    Does anyone have any thoughts/suggestions?

     

    Thanks

     

    Jason

     

     

    Tuesday, January 29, 2008 12:06 AM

Answers

  • This msdn article

    http://msdn2.microsoft.com/en-us/library/ms947923.aspx

    gave me some insight.

     

    You might be able to edit the FileDialg.htm so this navigates automatically - but by drilling a bit deeper into the webbrowser object, I was able to hook into the click events of the loaded document.

     

    Using something like:

     

    private void folderBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)

    {

    if (folderBrowser.Document != null)

    {

    HtmlElement fileDialogViewTable = folderBrowser.Document.GetElementById("FileDialogViewTable");

    // add a double click event to each row of the file dialog table

    foreach (HtmlElement fileRow in fileDialogViewTable.GetElementsByTagName("TR"))

    {

    fileRow.DoubleClick += new HtmlElementEventHandler(fileRow_DoubleClick);

    }

    }

    }

    void fileRow_DoubleClick(object sender, HtmlElementEventArgs e)

    {

    HtmlElement element = (HtmlElement)sender;

    MessageBox.Show("The new url is:" + element.Id);

    }

     

    I added double click events to the files & folders allowing me to retrieve target urls. Using these I could then use the Navigate method on the folderBrowser (webbrowser control).

     

    There maybe a nicer solution to this problem - but this one is working for me.

     

     

    Tuesday, January 29, 2008 2:24 AM

All replies

  • This msdn article

    http://msdn2.microsoft.com/en-us/library/ms947923.aspx

    gave me some insight.

     

    You might be able to edit the FileDialg.htm so this navigates automatically - but by drilling a bit deeper into the webbrowser object, I was able to hook into the click events of the loaded document.

     

    Using something like:

     

    private void folderBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)

    {

    if (folderBrowser.Document != null)

    {

    HtmlElement fileDialogViewTable = folderBrowser.Document.GetElementById("FileDialogViewTable");

    // add a double click event to each row of the file dialog table

    foreach (HtmlElement fileRow in fileDialogViewTable.GetElementsByTagName("TR"))

    {

    fileRow.DoubleClick += new HtmlElementEventHandler(fileRow_DoubleClick);

    }

    }

    }

    void fileRow_DoubleClick(object sender, HtmlElementEventArgs e)

    {

    HtmlElement element = (HtmlElement)sender;

    MessageBox.Show("The new url is:" + element.Id);

    }

     

    I added double click events to the files & folders allowing me to retrieve target urls. Using these I could then use the Navigate method on the folderBrowser (webbrowser control).

     

    There maybe a nicer solution to this problem - but this one is working for me.

     

     

    Tuesday, January 29, 2008 2:24 AM
  • Hi Jason,

    i have a similer requirements. Im working on outlook add in so that user can move thier file to sharepoint site it should replaced with their links to that document moved.

    I am able to move. i want to show sharepoint documents in folderbrowerdialog box.. How did u achieve this?

    http://www.zimmergren.net/archive/tags/Client%20Object%20Model/default.aspx

    i also checked this site.. but my requirement is to show Wep Page dialog so that user can save it wichver document library folder they want?

    how can i achive that dialog box?

    Wednesday, July 28, 2010 11:18 AM