![]() |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
![]()
I have a document with a series of tables containing a photo in the upper left cell and a description including a auto-numbered paragraph in the upper right cell.
I have used this code to insert the list number With ListGalleries(wdNumberGallery).ListTemplates(1).Li stLevels(1) Select Case Trim(gCapType) Case "Photo" .NumberFormat = "Photo %1:" PrevCaptionType = "Photo" Case "Figure" .NumberFormat = "Figure %1:" PrevCaptionType = "Figure" Case "Illustration" .NumberFormat = "Illustration %1:" PrevCaptionType = "Illustration" Case "Scan" .NumberFormat = "Scan %1:" PrevCaptionType = "Scan" Case "User Specified" 'NEED CODE HERE TO HANDLE SPECIAL CASE End Select .TrailingCharacter = wdTrailingNone .NumberStyle = wdListNumberStyleArabic .NumberPosition = InchesToPoints(0) .Alignment = wdListLevelAlignLeft .TextPosition = InchesToPoints(0.5) .TabPosition = wdUndefined .ResetOnHigher = 0 '.StartAt = 1 .Font.Bold = True .LinkedStyle = "" End With Selection.Range.ListFormat.ApplyListTemplate _ ListTemplate:=ListGalleries(wdNumberGallery).ListT emplates(1), _ ContinuePreviousList:=True, _ ApplyTo:=wdListApplyToSelection, _ DefaultListBehavior:=wdWord10ListBehavior 'UPDATE THE CAPTION NUMBER Selection.Range.Fields.Update the lists have no trouble renumbering when I delete a table from the sequence, but when insert a new table with its associated data in many circumstances it does not update the field with the new numbering. I have tried several methods to update the field including reselecting each cell with an expected change and applying Selection.Range.Fields.Update I have also tried looping through the fields in the fields collection. Neither approach updates all of the cases for inserting before or after the originally selected table and at the boundary conditions for the beginning and ending of the section. A section break is used when the paragraph label changes (ie. "Photo:" to "Figure:") Any suggestions for a way to force the renumbering to happen reliably would be welcome. |
Tags |
renumber para # fields |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
table cell values to another word document paragraph | abonsey | Word VBA | 3 | 06-16-2022 04:36 AM |
![]() |
HealthyStealthy | Word | 2 | 09-06-2016 06:36 AM |
Replace 0000s with a series of numbers | tingker | Word VBA | 2 | 12-17-2014 06:06 AM |
![]() |
Joey Cheung | Word Tables | 1 | 08-12-2014 05:19 PM |
Remove Paragraph numbers from Table of Co | Bu_zz2020 | Word | 3 | 08-27-2013 08:49 AM |