View Single Post
  #3   Report Post  
Posted to microsoft.public.word.pagelayout
SV SV is offline
external usenet poster
 
Posts: 25
Default Linking to a Field

Doug,
I'm not sure if I've been clear. I'll try an example:

I have 20 parts, each of which is shown on figure 6-3 and 40 parts, each of
which is shown on figure 6-4.
The parts list for figure 6-3 shows, in the first column, nothing but 6-3's
and the parts list for 6-4 shows nothing but 6-4's.
This is as it should be.

Now, I insert a figure between them, which is automatically numbered as 6-4
(because of the SEQ command), and 6-4's figure number automatically updates
to 6-5.
Unfortunately, the parts list for the old 6-4 (now 6-5) still shows all
"6-4" as they're all TEXT not fields or anything.
I'm looking for a way to have the figure number identifiers on the parts
list follow the number of the figure if it changes.

Shane

"Doug Robbins - Word MVP" wrote in message
...
If you part numbers are of the form

6-2-1

6-2-2

6-2-3



The following macro would increment the digit between the - - by 1 (each
time it is run)



Dim srange As Range
Dim i As Long, j As Long
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="6-[0-9]{1,}-[0-9]{1,}",
MatchWildcards:=True, _
MatchCase:=False, Wrap:=wdFindStop, Forward:=True) = True
Set srange = Selection.Range.Duplicate
Selection.Collapse wdCollapseEnd
Selection.MoveRight wdCharacter, 1
With srange
i = InStr(.Text, "-")
j = InStrRev(.Text, "-")
.Text = Left(.Text, i) & Mid(.Text, i + 1, j - i - 1) + 1 &
Mid(.Text, j)
End With
Loop
End With


Save a copy of the document before running it.
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"SV" wrote in message
...
Greetings,
I've inherited a Word document in which a figure is shown on one page,
and a list of the parts that make it up is shown on the page.
The figure caption uses the SEQ field command:

SEQ Figure_6- \* ARABIC

And so each figure in this section shows up as 6-1, 6-2, etc. No
problems so far.
The parts list on the next page refers to the figure, so the parts list
for figure 6-2 would have, before each item, "6-2" Still no problems.

We had to add a figure in the early parts of the book and, since the
figures were all identified using the SEQ field command, they all updated
without problem.

The parts lists, however, had their figure numbers in as text, not a
field, so I'm looking at having to go down 70 pages of parts lists and
updating each line number with a new figure number. I can do a "Highlight
the page, do find/replace" 70 times but aside from being darned tedious,
it'll have to be repeated if we end up adding another figure.

I tried inserting a cross-reference, but none of them gave the option of
cross-referencing to the field in the figure.

Given the SEQ field command on each figure, is there a way I can link the
parts lists to that field so that when the figure number changes, the
parts list is updated with it? Is there a field for numbering I can add
to the figure (in the way of white, therefore invisible, text) that WILL
take a cross-reference?

I'm using Word 2003 sp2 in XP.

Thanks,
Shane