DEV Community

Oscar Sun(孫守真字任真)
Oscar Sun(孫守真字任真)

Posted on

Answer: Word VBA - Add column to the right end of a table

Plz try my code to see:

Sub Word_VBA_Add_column_to_the_right_end_of_a_table()
    Dim tb As Word.Table, c As Word.cell, ur As Word.UndoRecord, d As Word.Document, r As Byte, cln As New VBA.Collection
    Dim newColumnWidth As Single
    Set ur = Word.Application.UndoRecord
    ur.StartCustomRecord "Word_VBA_Add_column_to_the_right_end_of_a_table"
    Set d = ActiveDocument
    Word.Application.ScreenUpdating = False
    For Each tb In d.Tables

Top comments (0)