Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2007

Tip: Looking for answers? Try searching our database.

Center-Align a table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Hashish - 15 Oct 2007 14:11 GMT
I need to center align some tables. I am using a macro in which I go to the
table using a bookmark and then do:

Selection.Tables(1).Rows.Alignment = wdAlignRowCenter

this seems to center-align a right-aligned table but is not working for a
left-aligned table. I am thoroughly stumped...!
Hashish - 15 Oct 2007 14:29 GMT
I think i should add...

this problem occurs if the tables have 'text wrapping' selected as 'Around'
in 'Table Properties'. if 'text wrapping' is selected as 'none' then no
problem occurs...

> I need to center align some tables. I am using a macro in which I go to the
> table using a bookmark and then do:
[quoted text clipped - 3 lines]
> this seems to center-align a right-aligned table but is not working for a
> left-aligned table. I am thoroughly stumped...!
Jonathan West - 15 Oct 2007 16:11 GMT
>I think i should add...
>
> this problem occurs if the tables have 'text wrapping' selected as
> 'Around'
> in 'Table Properties'. if 'text wrapping' is selected as 'none' then no
> problem occurs...

In that case, it would appear that you first set the wrapping to none.
precede your line of code with this

Selection.Tables(1).Rows.WrapAroundText = False

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

Hashish - 16 Oct 2007 07:34 GMT
Hey...thanx a ton. your code solved it. I dont know why that problem occurs
but atleast i managed to work around it..!

> >I think i should add...
> >
[quoted text clipped - 7 lines]
>
> Selection.Tables(1).Rows.WrapAroundText = False
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.