none
Content Control was deleted by unexpected operation, select ROWS key DELETE RRS feed

  • Question

  • I have a table, in the cell with content controls. I set content control's LockContentControl = true. 

    If I select the rows (WHOLE), and press DELETE key, the content control was deleted. 

    I think it's Word Bug, BUG BUG!


    XBRL Expert

    Tuesday, September 16, 2014 1:10 PM

All replies

  • Hi GuoHui,

    >>I have a table, in the cell with content controls. I set content control's LockContentControl = true. 

    If I select the rows (WHOLE), and press DELETE key, the content control was deleted.  <<

    Based on the description, did you lock the content control by code? Was the option checked like figure below?

    I failed to reproduce the issue in Word 2013, here are my test steps:
    1. inser a table

    2. put the cursor at the first cell

    3. run the code below to insert a content control

    Sub InsertContentControl()
    Dim objCC As ContentControl
    
    Set objCC = ActiveDocument.ContentControls _
        .Add(wdContentControlDate)
    
    objCC.Range.Text = "January 1, 2007"
    objCC.LockContents = True
    objCC.LockContentControl = True
    
    End Sub
    

    4. select the first row and press Delete( failed to delete the control)

    Could this issue be reproduced when you insert and lock the content control manually? Would you mind sharing more detail to help us to reproduce this issue?

    Best regards

    Fei


    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.

    Wednesday, September 17, 2014 2:53 AM
    Moderator
  • Sub SnrWordDelete()
       Dim addIn As Object
       Set addIn = GetMyAddIn()
       If Not (addIn Is Nothing) Then
        Call addIn.WordDelete
       Else
       Application.Selection.Delete
       End If
    End Sub

    Sub SnrSetupKeyBinding()
      CustomizationContext = ActiveDocument.AttachedTemplate 
      KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyDelete), KeyCategory:=wdKeyCategoryCommand, Command:="SnrWordDelete"
    End Sub

    Press Delete call my VBA code.


    XBRL Expert

    Tuesday, September 23, 2014 4:57 AM
  • Hi GuoHui,

    I still failed to reproduce the issue. The GetMyAddIn is not defined in the code. Did you install any add-ins?

    Regards

    Fei


    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.

    Tuesday, September 23, 2014 7:36 AM
    Moderator