Hi, how can I programmatically horizontally center the text in a table row / cells ? TIA
Set the Alignment property of the ParagraphFormat property of the Range of the selected cell to wdAlignParagraphCenter. For example: ActiveDocument.Tables(1).Range.Cells(1).Range.ParagraphFormat.Alignment=wdAlignParagraphCenter horizontally centres the text in the first cell of the first table in the active document. -- Cheers! Gordon Uninvited email contact will be marked as SPAM and ignored. Please post all follow-ups to the newsgroup. "MoiMeme" wrote: > Hi, > > how can I programmatically horizontally center the text in a table row / > cells ? > > TIA > > > >
BTW, if you want to centre the text in an entire row, just substitute 'Rows' for 'Cells' - something like this: ActiveDocument.Tables(1).Range.Rows(2).Range.ParagraphFormat.Alignment = wdAlignParagraphCenter which centres the text in every cell in the second row of the first table in the active document. -- Cheers! Gordon Uninvited email contact will be marked as SPAM and ignored. Please post all follow-ups to the newsgroup. "MoiMeme" wrote: > Hi, > > how can I programmatically horizontally center the text in a table row / > cells ? > > TIA > > > >
On Mon, 22 Sep 2008 21:06:41 +0200, "MoiMeme" wrote: >Hi, > >how can I programmatically horizontally center the text in a table row / >cells ? > >TIA > Leaving it up to you to choose the right table and row... With ActiveDocument.Tables(1).Rows(2) .Range.Paragraphs.Alignment = wdAlignParagraphCenter End With -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
"MoiMeme" a écrit dans le message de news: eBc4JZOHJHA.4408@TK2MSFTNGP06.phx.gbl... > Hi, > > how can I programmatically horizontally center the text in a table row / > cells ? > > TIA > > >