none
How to access parent data from dialog RRS feed

  • Question

  • Hi all, 

     I am developing Word 2007 adding. What I have done is created a customTaskPane and then added a custom control in it. This custom control contains a tree. Now on button click from this control I want to open a dialog window which will again have same tree. 

    But I am not able to access parent data from dialog's load event.

    For creating dialog window, I have implemented  Microsoft.Office.Interop.Word.Dialog class, then created a object of the class and called show. While implementing the Dialog interface couple of getter methods apper for which I have returned nothing.

    Can you please guide me that what is good coding tecting when you want to open a dialog in Word addin (Task Pane)?

    How to access data to and from dialog / parent window?

    Regards,

    Tanmay.

    Friday, October 26, 2012 12:25 PM

Answers

  • Hi All,

     I have solved the query about sending data from parent window to client window. 

    Create a public property in the dialog class.

    Before using show() method to show the dialog, assign data though this property.

    Now my query is how does parent knows that dialog window is closed? 

    while using dialog.show() method contol does not wait for return value and passes on. So how to notify parent that dialog activity is completed and how it should take data from dialog window?

    • Marked as answer by Tanmay.in Friday, October 26, 2012 1:11 PM
    Friday, October 26, 2012 1:07 PM
  • Above issue is also resolved by using .ShowDialog() method instead of .Show() method.

    • Marked as answer by Tanmay.in Friday, October 26, 2012 1:11 PM
    Friday, October 26, 2012 1:11 PM

All replies

  • Hi All,

     I have solved the query about sending data from parent window to client window. 

    Create a public property in the dialog class.

    Before using show() method to show the dialog, assign data though this property.

    Now my query is how does parent knows that dialog window is closed? 

    while using dialog.show() method contol does not wait for return value and passes on. So how to notify parent that dialog activity is completed and how it should take data from dialog window?

    • Marked as answer by Tanmay.in Friday, October 26, 2012 1:11 PM
    Friday, October 26, 2012 1:07 PM
  • Above issue is also resolved by using .ShowDialog() method instead of .Show() method.

    • Marked as answer by Tanmay.in Friday, October 26, 2012 1:11 PM
    Friday, October 26, 2012 1:11 PM