Why OnBeforeDocumentClose_info is called destination file during drag drop operation.

Papita Awale 1 Reputation point
2021-01-20T05:47:02.31+00:00

We have hooked Word event OnBeforeDocumentClose_info into our code,
we are performing drag drop operation, i.e. dragging word document 1 to word document2, word document 2 is already in open state,
We had already checked and found that during drag drop operation source file is internally opened and hence it is obvious that close will happen for source document only at the end of drag drop operation.

But recently on office19 , we have found that close event (OnBeforeDocumentClose_info) is being triggered for destination document at the end of drag drop operation, we have verified that file open event is not called for destination document during drag drop operation, then why close event is being triggered for it.

  1. can you please confirm why Close event is triggered for destination file during drag drop operation as Open event wasn't triggered for it (this is our understanding that during drag drop operation Open and Close events should be called for only source file)
  2. I also wanted to check if there is any API through which event OnBeforeDocumentClose_info is triggered
    {for eg: if i call 'officeObject.save' , then it internally triggers 'ReplaceFileW' , we have hooked ReplaceFileW in our code, & we already knew that ReplaceFileW is called through 'officeObject.save' , same way we wanted to check which office API is triggering OnBeforeDocumentClose_info}
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Emi Zhang-MSFT 22,011 Reputation points Microsoft Vendor
    2021-01-21T02:22:53.893+00:00

    Hi @Papita Awale ,
    Based on your description, I will change the tag to office-vba-dev, this is a way for Office developers ask question. The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments