Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #16  
Old 08-30-2012, 04:33 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
If you create a new caption label to say 'Fig.' instead of 'Figure', and use that when you insert the caption, that's how it will display - and you won't need the macro.
Too late for that I am afraid; too many instances to change manually
Thank you for your fast reply
Nils
Reply With Quote
  #17  
Old 08-30-2012, 05:51 AM
macropod's Avatar
macropod macropod is offline Making cross-reference say "Fig." instead of "Figure" Windows 7 64bit Making cross-reference say "Fig." instead of "Figure" Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #18  
Old 11-09-2014, 06:25 AM
Malcolm Lear Malcolm Lear 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: Nov 2014
Posts: 1
Malcolm Lear is on a distinguished road
Default

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
Reply With Quote
Reply



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 12:24 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