none
Cant insert row on table in Word RRS feed

  • Question

  • I have an existing document with an existing table it in and I have inserted rows in Word thousands of time in the past but for this document I insert above or below and nothing happens.

    Why?

    Wednesday, December 4, 2013 7:14 PM

Answers

  • Hi,

    Have you fixed this issue? As Cindy and Paul saied, to fix this issue we need more detail. Could you share us the document you have the issue or provide some codesnippet?

    In addition, I used VBA code below to create a table and insert a row:

    Sub CreateTable()
    
        ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=3, NumColumns:= _
            4, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _
            wdAutoFitFixed
        With Selection.Tables(1)
            If .Style <> "Table Grid" Then
                .Style = "Table Grid"
            End If
            .ApplyStyleHeadingRows = True
            .ApplyStyleLastRow = False
            .ApplyStyleFirstColumn = True
            .ApplyStyleLastColumn = False
            .ApplyStyleRowBands = True
            .ApplyStyleColumnBands = False
        End With
    End Sub
    Sub InsertRow()
    ActiveDocument.Tables(1).Rows.Add ActiveDocument.Tables(1).Rows(2)
    End Sub

    Could you run it successfully?

    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.


    Monday, December 9, 2013 11:32 AM
    Moderator

All replies

  • Without know more about the Word version, document & table in question, the ability to provide meaningful help is limited.

    What version of Word are you using? Does the table have text-wrapping enabled? Are you sure the table isn't in a protected portion of the document? Is the table in the page header, footer, a textbox or nested inside another table?


    Cheers
    Paul Edstein
    [MS MVP - Word]

    Wednesday, December 4, 2013 10:23 PM
  • Also, as this is a programming forum, please show us the code you're using that's failing.

    Cindy Meister, VSTO/Word MVP, my blog

    Friday, December 6, 2013 3:43 PM
    Moderator
  • Hi,

    Have you fixed this issue? As Cindy and Paul saied, to fix this issue we need more detail. Could you share us the document you have the issue or provide some codesnippet?

    In addition, I used VBA code below to create a table and insert a row:

    Sub CreateTable()
    
        ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=3, NumColumns:= _
            4, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _
            wdAutoFitFixed
        With Selection.Tables(1)
            If .Style <> "Table Grid" Then
                .Style = "Table Grid"
            End If
            .ApplyStyleHeadingRows = True
            .ApplyStyleLastRow = False
            .ApplyStyleFirstColumn = True
            .ApplyStyleLastColumn = False
            .ApplyStyleRowBands = True
            .ApplyStyleColumnBands = False
        End With
    End Sub
    Sub InsertRow()
    ActiveDocument.Tables(1).Rows.Add ActiveDocument.Tables(1).Rows(2)
    End Sub

    Could you run it successfully?

    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.


    Monday, December 9, 2013 11:32 AM
    Moderator
  • Hi,

    Since we haven't heard from you for a long time, I temporarily close this case. I mark useful reply as answer. If you have any concerns, please free feel to reopen it or submit a new question.

    Thanks for your understanding.

    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.

    Thursday, December 12, 2013 2:15 AM
    Moderator