Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #12  
Old 08-30-2012, 04:00 AM
myusername myusername is offline Making cross-reference say "Fig." instead of "Figure" Windows XP Making cross-reference say "Fig." instead of "Figure" Office 2003
Novice
 
Join Date: Aug 2012
Posts: 2
myusername is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Unfortunately, there's nothing in the field code you can edit. If you select one of the fields and press Shift-F9, you'll be able to see the field code - and it won't have 'Figure', 'Table' or any other indicator of the caption type. If you were to use Find/Replace on the field results, that would be ineffective, as the fields will revert to their original display as soon as anything causes the cross-references to update. The only way around that - and it could be useful when the document is at it's 'Final' stage, would be to edit the display via a macro, then either lock or unlink the fields. The following macro uses a 'lock' approach, so that the references can be updated later on (by re-running the macro) if need be:
Code:
Sub AbbreviateCaptions()
Dim Fld As Field
For Each Fld In ActiveDocument.Fields
  With Fld
    If Left(.Result.Text, 6) = "Figure" Then
      .Locked = False
      .Update
      .Result.Text = Replace(.Result.Text, "Figure", "Fig.", 1, 1)
      .Locked = True
    End If
  End With
Next
End Sub
Thank you for the nice code. I found it useful. It is possible to the the same to also change the label at the figure captions. i.e. after application of the macro it says 'Figure 8' at the caption but 'Fig. 8' in the reference. Can the macro be modified to change the label in the figure caption too?
best regards
Nils
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Making cross-reference say "Fig." instead of "Figure" Issues with Word 2007: making "--" into "—" 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
Making cross-reference say "Fig." instead of "Figure" "Table of content" based on "Normal Style" behavior!!!! Jamal NUMAN Word 4 07-08-2011 04:12 AM
Making cross-reference say "Fig." instead of "Figure" How to choose a "List" for certain "Heading" from "Modify" tool? 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

Other Forums: Access Forums

All times are GMT -7. The time now is 04:27 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft