none
At the time of opening the word file word should fix the table rows height to exactly for all the tables in a documents RRS feed

  • Question

  • Hi,

    I am looking for a way so that whenever someone opens a word document which contains the tables it should change the row height to exactly.

    Regards
    Rajaniesh

    Wednesday, June 7, 2017 10:53 PM

All replies

  • Hi,

    I am looking for a way so that whenever someone opens a word document which contains the tables it should change the row height to exactly.

    Regards
    Rajaniesh

    Wednesday, June 7, 2017 10:57 PM
  • Hello,

    You could handle Document.Open Event (Word) loop through each table and set its row height.

    Please visit Using Events with the Document Object to see where and how we could handle the events.

    E.g.

    Private Sub Document_Open()
    For Each tb In ActiveDocument.Tables
    tb.Rows.HeightRule = wdRowHeightExactly
    tb.Rows.Height = InchesToPoints(0.5)
    Next
    End Sub
    

    Regards,

    Celeste


    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.

    Thursday, June 8, 2017 7:07 AM
    Moderator
  • Thank YOU for the quick reply but the issue is that I need to set this property only for tables where the issue is there. In all the tables it does not shows the same issue and it only happens on specific tables. How do we identify that? For example here is the correct Table:

    and here is the incorrect Table with space between rows. 

    so if we found the table where it is incorrect we need to make it correct.


    Thursday, June 8, 2017 1:11 PM
  • Actually I wan to go to nested tables and apply the same logic there

    Thursday, June 8, 2017 9:33 PM
  • To change the property only for the tables where the issues is there, you still need to loop through all tables and check if the property is correct and then reset it. Since the final result is that all tables have the same exactly row height, there is no need to identify which tables should be skipped.

    For nested tables, please visit your another thread: https://social.msdn.microsoft.com/Forums/office/en-US/4c5d0362-cf49-4bf7-8f4d-f2caa3c35ca2/nested-table-manipulation-in-word?forum=worddev

    Besides, please do not post duplicated threads for a same issue.


    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.


    Friday, June 9, 2017 7:19 AM
    Moderator