B
Bryan
Hello All :
Would appreciate sample code or help in placing TWO tables in the header of
a word document using VBA. I can put one table in the header, but trying two
gives me a error 6028. range can not be deleted.
Here is what I have so far for adding the table
Dim r As Range, t As Table, t2 as Table
Set r = ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range
Set t = ActiveDocument.Tables.Add(Range:=r2, NumRows:=1, NumColumns:=3)
With t
.Rows.Height = 30
.Columns(1).SetWidth 500, wdAdjustSameWidth
.Cell(1, 2).Range.Bold = True
.Columns(2).SetWidth 500, wdAdjustSameWidth
.Columns(3).SetWidth 200, wdAdjustSameWidth
End With
""'error when adding a second table 6082 Can not delete Range"""
Set t = ActiveDocument.Tables.Add(Range:=r2, NumRows:=1, NumColumns:=6)
With t2
........
end with
Would appreciate sample code or help in placing TWO tables in the header of
a word document using VBA. I can put one table in the header, but trying two
gives me a error 6028. range can not be deleted.
Here is what I have so far for adding the table
Dim r As Range, t As Table, t2 as Table
Set r = ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range
Set t = ActiveDocument.Tables.Add(Range:=r2, NumRows:=1, NumColumns:=3)
With t
.Rows.Height = 30
.Columns(1).SetWidth 500, wdAdjustSameWidth
.Cell(1, 2).Range.Bold = True
.Columns(2).SetWidth 500, wdAdjustSameWidth
.Columns(3).SetWidth 200, wdAdjustSameWidth
End With
""'error when adding a second table 6082 Can not delete Range"""
Set t = ActiveDocument.Tables.Add(Range:=r2, NumRows:=1, NumColumns:=6)
With t2
........
end with