![]() |
#16
|
|||
|
|||
![]() Quote:
Thank you for your fast reply Nils |
#17
|
||||
|
||||
![]()
Even so, if you replace 'Figure' with 'Fig.' on all the captions (which you can do with Find/Replace, setting the Find Style to 'Caption'), you still won't need the macro - simply do Ctrl-A, F9 to update all the cross-references.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#18
|
|||
|
|||
![]()
Hi,
Thanks for that code, excellent :-) I had the same problem and cant believe MS Word still has no solution for this. A simple character mask would suffice. However the code solves the issue and I've made some enhancements to suit my own requirements. Table 1.1: > Table 1.1 Figure 1.1: > Fig. 1.1 There are two procedures, one to abbreviate and the other to normalize. Sub AbbreviateCaptions() Dim Fld As Field For Each Fld In ActiveDocument.Fields With Fld If Left(.Result.Text, 6) = "Figure" And Right(.Result.Text, 1) = ":" Then .Locked = False .Update .Result.Text = Replace(.Result.Text, "Figure", "Fig.", 1, 1) .Result.Text = Replace(.Result.Text, ":", "", 1, 1) .Locked = True End If If Left(.Result.Text, 5) = "Table" And Right(.Result.Text, 1) = ":" Then .Locked = False .Update .Result.Text = Replace(.Result.Text, ":", "", 1, 1) .Locked = True End If End With Next End Sub Sub NormalizeCaptions() Dim Fld As Field For Each Fld In ActiveDocument.Fields With Fld If Left(.Result.Text, 4) = "Fig." Then .Locked = False .Update End If If Left(.Result.Text, 5) = "Table" Then .Locked = False .Update End If End With Next End Sub |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
kg28 | Word | 1 | 02-04-2012 01:33 PM |
How to edit the "Format" and the "show level" of an EXISTING table of content? | Jamal NUMAN | Word | 2 | 08-14-2011 10:46 AM |
![]() |
Jamal NUMAN | Word | 4 | 07-08-2011 04:12 AM |
![]() |
Jamal NUMAN | Word | 2 | 07-03-2011 03:11 AM |
"Microsoft Excel Application" missing in the "Component Services" on win08 | sword.fish | Excel | 0 | 02-26-2010 02:09 PM |