Discussion:
Word VBA code to center align Table in Header and Footer
(too old to reply)
Gaurav
2009-11-14 12:10:01 UTC
Permalink
Hi,

I have some tables in Header and Footer of Word 2007 document which has some
manual settings for its left margines in Inches.

I need some code to forcefully reset the Tables in Header and Footer to
Center align Horizontally.

I used the following code but does not seems to do anything:

With ActiveDocument.Sections(iSectionIndex)
.Headers(wdHeaderFooterPrimary).Range.ParagraphFormat.Alignment =
wdAlignParagraphCenter
End With

Please suggest the possible code to resolve this.
Doug Robbins - Word MVP
2009-11-14 21:45:11 UTC
Permalink
Use:

With ActiveDocument.Sections(iSectionIndex)
.Headers(wdHeaderFooterPrimary).Range.Tables(1).Rows.Alignment =
wdAlignRowCenter
End With
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
Post by Gaurav
Hi,
I have some tables in Header and Footer of Word 2007 document which has some
manual settings for its left margines in Inches.
I need some code to forcefully reset the Tables in Header and Footer to
Center align Horizontally.
With ActiveDocument.Sections(iSectionIndex)
.Headers(wdHeaderFooterPrimary).Range.ParagraphFormat.Alignment =
wdAlignParagraphCenter
End With
Please suggest the possible code to resolve this.
Loading...