![]() |
|
#21
|
||||
|
||||
|
As written, the code checks whether it is exiting the last content control in the table. The number of content controls in that row is of no consequence. Indeed, the code was tested against tables having every possible kind of content control in a given row - including multiples of the same kind.
That said, it was not envisaged that the code would be run against a table having multiple content controls in the same cell. That could be accomodated by changing: Code:
'Get our ContentControl's index # in the table j = ActiveDocument.Range(.Range.Tables(1).Range.Start, .Range.End).ContentControls.Count Code:
'Get our ContentControl's index # in the table j = ActiveDocument.Range(.Range.Tables(1).Range.Start, .Range.Cells(1).Range.Start).ContentControls.Count j = j + ActiveDocument.Range(.Range.Cells(1).Range.Start, .Range.End).ContentControls.Count
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Colour code mail merge header table cell backgrounds
|
ScotsMaverick | Mail Merge | 25 | 11-04-2021 02:07 PM |
Code to disable spacing between cells in table properties
|
bloomhaven | Word VBA | 3 | 03-11-2015 04:08 PM |
| Creating VBA Code to Delete Empty Column in Table | Faugs | Word VBA | 5 | 08-07-2014 03:29 PM |
VBA Code to take data from a table in word document and place it in a summary table
|
VBLearner | Word VBA | 1 | 03-09-2014 08:42 PM |
| VBA sort table code | mikec | Excel Programming | 8 | 10-01-2013 04:37 PM |