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 / April 2007

Tip: Looking for answers? Try searching our database.

How to determine Table Indent

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
survivor - 12 Apr 2007 23:00 GMT
I used to use Table.Rows.LeftIndent property to determine a table's indent
value. If this is value was set to wdUndefined then usually
Table.Rows(0).LeftIndent is the most appropriate since some documents tend
to indent all other rows slightly to enhance the appearance. I have found
that some tables have vertically merged cells so individual rows cannot be
accessed. However, Word reports the correct value from the Table Properties
menu. Is there a way to obtain the indent value in VBA under these
conditions? (Table.Rows.Leftindent returns wdUndefined and the table has
vertically merged cells)
Helmut Weber - 13 Apr 2007 02:49 GMT
Hi Survivor,

just a workaround, if there is no better solution,
split the table temporarily, like:

Sub testx23()

With Selection.Tables(1).Range
  .Cells(.Cells.Count).Select
End With
Selection.SplitTable
Selection.MoveDown
MsgBox Selection.Tables(1).Rows(1).LeftIndent
ActiveDocument.Undo 1
End Sub

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

survivor - 13 Apr 2007 22:02 GMT
Less than ideal but it works. A clever trick but, as you mentioned, good as
a workaround. Thank you

> Hi Survivor,
>
[quoted text clipped - 11 lines]
> ActiveDocument.Undo 1
> End Sub
Tony Jollans - 13 Apr 2007 12:03 GMT
I *think* this should always work:

   <table_ref>.Range.Cells(1).Range.Rows.LeftIndent

Signature

Enjoy,

Tony Jollans
Microsoft Word MVP

>I used to use Table.Rows.LeftIndent property to determine a table's indent
>value. If this is value was set to wdUndefined then usually
[quoted text clipped - 5 lines]
>conditions? (Table.Rows.Leftindent returns wdUndefined and the table has
>vertically merged cells)
survivor - 13 Apr 2007 22:03 GMT
This works on my document. Thank you. Not intuitive though

>I *think* this should always work:
>
[quoted text clipped - 9 lines]
>>these conditions? (Table.Rows.Leftindent returns wdUndefined and the table
>>has vertically merged cells)
 
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.