Discussion:
Table Repeating Issue
(too old to reply)
douglasgerlach
2012-04-18 14:22:35 UTC
Permalink
I have the following macro and i cannot figure out why i cannot get thi
header to repeat on subsequent pages any thoughts?

ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=1
NumColumns:= _
1, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:
_
wdAutoFitFixed

With Selection.Tables(1)
If .Style <> "Table Grid" Then
.Style = "Table Grid"
End If
.ApplyStyleHeadingRows = True
.ApplyStyleLastRow = True
.ApplyStyleFirstColumn = True
.Rows(1).HeadingFormat = True
End With

Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
Selection.Cells.VerticalAlignment = wdCellAlignVerticalCenter
Selection.Font.Name = "Courier New"
Selection.Font.Size = 11
Selection.TypeText Text:="CHANGED P/N INFORMATION"

Selection.NextField


Selection.Tables(1).Columns(1).SetWidth ColumnWidth:=565
RulerStyle:= _
wdAdjustNone


Selection.MoveDown Unit:=wdLine, Count:=1



i have other macros where i can get it to repeat but with this one
cannot.
thank


--
douglasgerlach
Stefan Blom
2012-04-20 10:43:49 UTC
Permalink
Make sure that the table does not contain a page break somewhere,
because if it does it has actually been split into two separate tables.
--
Stefan Blom
Microsoft Word MVP
I have the following macro and i cannot figure out why i cannot get this
header to repeat on subsequent pages any thoughts?
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=1,
NumColumns:= _
1, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:=
_
wdAutoFitFixed
With Selection.Tables(1)
If .Style<> "Table Grid" Then
.Style = "Table Grid"
End If
.ApplyStyleHeadingRows = True
.ApplyStyleLastRow = True
.ApplyStyleFirstColumn = True
.Rows(1).HeadingFormat = True
End With
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
Selection.Cells.VerticalAlignment = wdCellAlignVerticalCenter
Selection.Font.Name = "Courier New"
Selection.Font.Size = 11
Selection.TypeText Text:="CHANGED P/N INFORMATION"
Selection.NextField
Selection.Tables(1).Columns(1).SetWidth ColumnWidth:=565,
RulerStyle:= _
wdAdjustNone
Selection.MoveDown Unit:=wdLine, Count:=1
i have other macros where i can get it to repeat but with this one i
cannot.
thanks
Loading...