Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Linking to a Field
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 |
#2
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Linking to a Field
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 |
#3
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
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 |
#4
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Linking to a Field
Hi Sv,
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. You can bookmark the entire figure number, then use a REF field instead of the static "6-n" numbering for each part. For example, you can select the 6-4 text then Insert/Bookmark. Type a descriptive name (Part_test, for example). Now delete the 6-4 in front of a part designation, press Ctrl+F9 to insert field brackets and type REF Part_test. Shift+F9 will hide the field code. From here on, you can copy the field and paste it over the other numbers. If you insert another set in front of the 6-4 information, once all the fields in the document are updated (Ctrl+A, F9 will force this), all the Ref Part_test fields will display 6-5, same as the Figure caption. Another way to do this would be to use Insert/References/Cross reference but I find that slower and less easy to maintain (the bookmark names are many-digit numbers) than the "manual approach". Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
#5
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Linking to a Field
Cindy,
Ah, I figured there had to be a way, thanks! Now to update the rest of the document and use it in future documents! Thanks, Shane "Cindy M." wrote in message news:VA.00000997.007d7ba8@speedy... Hi Sv, 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. You can bookmark the entire figure number, then use a REF field instead of the static "6-n" numbering for each part. For example, you can select the 6-4 text then Insert/Bookmark. Type a descriptive name (Part_test, for example). Now delete the 6-4 in front of a part designation, press Ctrl+F9 to insert field brackets and type REF Part_test. Shift+F9 will hide the field code. From here on, you can copy the field and paste it over the other numbers. If you insert another set in front of the 6-4 information, once all the fields in the document are updated (Ctrl+A, F9 will force this), all the Ref Part_test fields will display 6-5, same as the Figure caption. Another way to do this would be to use Insert/References/Cross reference but I find that slower and less easy to maintain (the bookmark names are many-digit numbers) than the "manual approach". Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Setting Date property in a form field | Microsoft Word Help | |||
Insert a bookmark field | Microsoft Word Help | |||
Word: IF statement to merge a field only if another Field is popul | Mailmerge | |||
Linking "SaveDate" Field to another document | Microsoft Word Help | |||
Text Form Field Ref in Footer Won't Update on Screen | Microsoft Word Help |