Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Mon, 22 Sep 2008 21:06:41 +0200,    group: microsoft.public.word.vba.general        back       


How center horizontally text in a cell ?   
Hi,

how can I programmatically horizontally center the text in a table row / 
cells ?

TIA
date: Mon, 22 Sep 2008 21:06:41 +0200   author:   MoiMeme

RE: How center horizontally text in a cell ?   
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
> 
> 
> 
>
date: Mon, 22 Sep 2008 16:50:00 -0700   author:   Gordon Bentley-Mix gordon(dot)bentleymix(at)gmail(dot)com

RE: How center horizontally text in a cell ?   
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
> 
> 
> 
>
date: Mon, 22 Sep 2008 17:03:01 -0700   author:   Gordon Bentley-Mix gordon(dot)bentleymix(at)gmail(dot)com

Re: How center horizontally text in a cell ?   
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.
date: Mon, 22 Sep 2008 21:04:22 -0400   author:   Jay Freedman

Thanks to all - worked fine !   
"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
>
>
>
date: Tue, 23 Sep 2008 16:55:08 +0200   author:   MoiMeme

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us