Mavila
09-21-2016, 11:47 AM
Is there any reason why a line shape in the header of a page would get deleted when I insert a table in the footer of the same page?
I put the shape into the header like so:
Set ShpLine = ActiveDocument.Sections(ActiveDocument.Sections.Count).Footers(wdHeaderFoot erPrimary).Shapes.AddLine(72, 60, 568, 60)
With ShpLine
.Line.ForeColor.RGB = RGB(0, 0, 0) 'Black line
.Line.Weight = 3
End With
I use the following to insert a table into the footer and PRESTO! the header shape (line) disappears:
Set myTable = ActiveDocument.Tables.Add(Range:=ActiveDocument.Sections(ActiveDocument.Sec tions.Count).Footers(wdHeaderFooterPrimary).Range.Paragraphs(ActiveDocument .Sections(ActiveDocument.Sections.Count).Footers(wdHeaderFooterPrimary).Ran ge.Paragraphs.Count).Range, numrows:=3, numcolumns:=3, AutoFitBehavior:=wdAutoFitFixed)
I put the shape into the header like so:
Set ShpLine = ActiveDocument.Sections(ActiveDocument.Sections.Count).Footers(wdHeaderFoot erPrimary).Shapes.AddLine(72, 60, 568, 60)
With ShpLine
.Line.ForeColor.RGB = RGB(0, 0, 0) 'Black line
.Line.Weight = 3
End With
I use the following to insert a table into the footer and PRESTO! the header shape (line) disappears:
Set myTable = ActiveDocument.Tables.Add(Range:=ActiveDocument.Sections(ActiveDocument.Sec tions.Count).Footers(wdHeaderFooterPrimary).Range.Paragraphs(ActiveDocument .Sections(ActiveDocument.Sections.Count).Footers(wdHeaderFooterPrimary).Ran ge.Paragraphs.Count).Range, numrows:=3, numcolumns:=3, AutoFitBehavior:=wdAutoFitFixed)