Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Word VBA code to center align Table in Header and Footer

1,041 views
Skip to first unread message

Gaurav

unread,
Nov 14, 2009, 7:10:01 AM11/14/09
to
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

unread,
Nov 14, 2009, 4:45:11 PM11/14/09
to
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

"Gaurav" <Gau...@discussions.microsoft.com> wrote in message
news:D41EB1EA-5DA0-432E...@microsoft.com...

0 new messages