none
Open document event custom dialog RRS feed

  • Question

  • We need to implement a custom open file dialog when using Microsoft Word 2016. I am using a VSTO Addin and unfortunately the DocumentOpen event is triggered only after the document is selected. 

    1) Is there any way to intercept the "before" DocumentOpen event?

    2) If not, is there any flag to check if the document is a new document or an existing document?

    • Moved by CoolDadTx Tuesday, July 3, 2018 1:51 PM Office related
    Tuesday, July 3, 2018 8:35 AM

Answers

  • Hello Amrhtha H,

    >>Is there any way to intercept the "before" DocumentOpen event?

    As far as I know, there is no such event could do this

    >>If not, is there any flag to check if the document is a new document or an existing document?

    Creating a new document should not trigger the DocumentOpen event, do you want to check it in other code? If so, once opening the document, you could try to check Document.Saved property. An existing document will be true and newly created document will be false.

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Terry Xu - MSFT Wednesday, July 4, 2018 3:16 AM
    • Marked as answer by Amrutha H Wednesday, July 4, 2018 8:55 AM
    Wednesday, July 4, 2018 3:16 AM