none
Document.ContentControlAfterAdd and Document.ContentControlBeforeDelete fired multiple times when in Undo/Redo on Word 2013 RRS feed

  • Question

  • Hi,

    I have noticed that if you create a content control in Word 2013 and then press Ctrl-Z (undo) the following events will be fired in the given order:

    1. ContentControlBeforeDelete
    2. ContentControlAfterAdd
    3. ContentControlBeforeDelete

    In Word 2010, only the (correct) ContentControlBeforeDelete is fired.

    The same, in reverse, can be observed if you press CTRL-Y (redo).

    This is in addition to an already reported bug where the ContentControlBeforeDelete event is fired for all Content Controls inside a table if you add a column to that table (no AfterAdd event fired).

    Best regards,

    Wednesday, October 15, 2014 12:21 PM

Answers

  • Hi,

    After testing in my Word 2013, when I create a content control into the document, it will fire the ContentControlAfterAdd event. Then if I press Ctrl-Z to undo, it will only fire the ContentControlBeforeDelete event. It is same as in Word 2010. 

    So I think I fail to reproduce your issue and the result is correct in both Word 2013 and 2010. I suggest you testing in other machines and installing the latest Service Pack for Microsoft Office 2013 to upgrade your Word 2013.

    I just test with the VBA macro code below.

    Private Sub Document_ContentControlAfterAdd(ByVal NewContentControl As ContentControl, ByVal InUndoRedo As Boolean)
    MsgBox "add"
    End Sub
    
    Private Sub Document_ContentControlBeforeDelete(ByVal OldContentControl As ContentControl, ByVal InUndoRedo As Boolean)
    MsgBox "delete"
    End Sub

    >>This is in addition to an already reported bug where the ContentControlBeforeDelete event is fired for all Content Controls inside a table if you add a column to that table (no AfterAdd event fired).<<

    About this case, I think I can reproduce, and as you said, it is an already reported bug.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by k0y0te Thursday, October 16, 2014 4:25 PM
    Thursday, October 16, 2014 6:47 AM
    Moderator
  • Hi,

    I thought I had the latest updates for Office but it seems that I did not have Sp1 installed.

    I can not reproduce it on Sp1, so this bug seems to have been fixed.

    Thanks for your help!

    • Marked as answer by k0y0te Thursday, October 16, 2014 4:25 PM
    Thursday, October 16, 2014 4:25 PM

All replies

  • Hi,

    After testing in my Word 2013, when I create a content control into the document, it will fire the ContentControlAfterAdd event. Then if I press Ctrl-Z to undo, it will only fire the ContentControlBeforeDelete event. It is same as in Word 2010. 

    So I think I fail to reproduce your issue and the result is correct in both Word 2013 and 2010. I suggest you testing in other machines and installing the latest Service Pack for Microsoft Office 2013 to upgrade your Word 2013.

    I just test with the VBA macro code below.

    Private Sub Document_ContentControlAfterAdd(ByVal NewContentControl As ContentControl, ByVal InUndoRedo As Boolean)
    MsgBox "add"
    End Sub
    
    Private Sub Document_ContentControlBeforeDelete(ByVal OldContentControl As ContentControl, ByVal InUndoRedo As Boolean)
    MsgBox "delete"
    End Sub

    >>This is in addition to an already reported bug where the ContentControlBeforeDelete event is fired for all Content Controls inside a table if you add a column to that table (no AfterAdd event fired).<<

    About this case, I think I can reproduce, and as you said, it is an already reported bug.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by k0y0te Thursday, October 16, 2014 4:25 PM
    Thursday, October 16, 2014 6:47 AM
    Moderator
  • Hi,

    I thought I had the latest updates for Office but it seems that I did not have Sp1 installed.

    I can not reproduce it on Sp1, so this bug seems to have been fixed.

    Thanks for your help!

    • Marked as answer by k0y0te Thursday, October 16, 2014 4:25 PM
    Thursday, October 16, 2014 4:25 PM