|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Numbered List - Auto Update para numbers that are referred to in later paragraphs.
I have a list that as shown in the attached document.
If there is an addition to or subtraction from the list, one must always remember to change the references in the paragraphs below. Is it possible to make that an automatic process? I’ve played around with inserting a Reference but that does not capture the period after the number nor does it capture if there is a new number 1. Also, it would be wonderful if the number would update automatically – not just on open, close or print. I don’t even know how to search for this. Any help would be much appreciated. |
#2
|
||||
|
||||
Using Cross References to do this will give you a field. All fields can be updated any time by selecting them and pressing F9. To update all the fields in the entire document you just press Ctrl-A then F9.
It is an odd requirement to expect the period to be included in the cross-reference field instead of just adding it after the field. It can be done if you modify the cross-ref field code to add a specific number formatting. For example you could change {REF _Ref22119258 \r \h} to {REF _Ref22119258 \r \h \# "#0."} I have no idea on what you expect to happen if a new number 1 clause is added. Are you saying clauses B and C should be smart enough to automatically include a cross-ref to the new 1 as an exclusion but not if I add a new clause 6?
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
Hi Andrew,
Thank you for replying. I'll try changing the field code. I've never done that before! If a new number 1 clause is added, the current number 1 is now number 2. The reference in the following paragraph needs to change to 2 so it is referencing the correct paragraph. Does that help? |
#4
|
|||
|
|||
Hi again, Andrew.
I finally got the field codes to do what I want them to do. I still can't figure out how to make the number 1 change to 2 if something is added before it. Any thoughts? |
#5
|
|||
|
|||
For the original number to change you need to be using some sort of Automatic numbering.
The simplest is numbering tied to styles. How to create numbered headings or outline numbering in Ribbon Versions of Word by Shauna Kelly You could also use SEQuence Fields. The first method can make cross-referencing even easier if the styles used are built-in heading styles. Why use Microsoft Word’s built-in heading styles? by Shauna Kelly |
#6
|
|||
|
|||
I do use automatic numbering from styles. So that's not the problem.
|
#7
|
|||
|
|||
Quote:
You are welcome to post a sample document with the problem. I would suggest making a copy of your problem document and editing it to remove confidential or proprietary information. How to attach a screenshot or file in this forum. [Edit after reading Andrew's post.] Yup, I was being undeservedly arrogant. I didn't think of someone doing it that way. If you use the built-in heading styles, you can cross reference to the heading and have it display the number. It would not help though, if you did as Andrew notes and try to insert a new heading at the beginning of an old one. That puts them both inside the bookmark. Also, if you use the option to display bookmarks, it does not display these bookmarks, because they are hidden. The bookmark is not generated until a Cross-Reference is created. Last edited by Charles Kenyon; 10-18-2019 at 06:15 AM. |
#8
|
||||
|
||||
Rob
The problem is how you are inserting the new 1. paragraph and how cross-references work. This post should explain where you are going wrong. When you insert a cross-ref to a paragraph number, Word sneakily bookmarks the source paragraph with a randomised name that starts with _Ref and finishes with a bunch of random numbers. This works fine if the bookmark remains wholly contained in that paragraph. BUT... When you then put your cursor at the start of that paragraph and press Enter to insert a paragraph ABOVE that paragraph, AND the bookmark also starts at this location, the hidden bookmark now includes that new paragraph (and finishes where it used to). This means the cross-ref now points at the new para 1 numbering instead of the (now) para 2 that you expected. To avoid this issue, get into the habit of NEVER inserting new paragraphs by putting your cursor at the start of paragraphs which may have a cross-reference pointing at it. Instead, put your cursor at the end of the paragraph above and press Enter there. That way the new paragraph is not included in the bookmark that the cross-ref is pointing at.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#9
|
|||
|
|||
This is exactly the sort of fascinating information I visit this forum for :-} if ever one of my less fortunate, Word-using colleagues asks me this question I shall be sure to give credit where it's due.
|
#10
|
||||
|
||||
FWIW, I use a macro to create cross-references to help reduce the inadvertent breaking caused by the mechanics of how cross-refs work. I find this is faster and works IMHO better in a number of ways.
1. I can see the bookmarks inserted via the macro (if I set my options to see bookmarks) so that I am less likely to make the mistake of inserting a new paragraph from the start of a bookmarked para. 2. I don't need to use the Insert Cross References dialog, change type and scroll to find an entry that is most likely already visible on my screen. 3. I can reinstate bookmarks in the GUI if they have been removed inadvertently. (The GUI on current versions of Word won't let you (re)create a bookmark name that starts with "_" although you could do this in older versions of Word or via VBA) 4. When adding a cross-ref to a paragraph number, I can strategically place these bookmarks NOT at the start of a paragraph to allow me to actually add paragraphs in the way I have been advising you not to. The cross-ref to a para number doesn't care if the bookmark isn't the first thing in a paragraph so I can position the bookmark somewhere after the first character for safety. The following macro works differently depending on whether you select text or just position your cursor in a paragraph. Either way, it creates a cross-ref and stores it in the clipboard so you can then paste the cross-ref in one (or more) locations. Code:
Sub MakeXRef() 'Creates two different types of cross references depending on selection Dim sRef As String, aXRef As Field, aRng As Range, sFieldCode As String Dim aRng2 As Range, aBkmk As Bookmark, sPrefix As String Set aRng = Selection.Range 'Check to see if we can reuse an existing bookmark or need to create a new one For Each aBkmk In aRng.Bookmarks If aBkmk.Range = aRng Then sRef = aBkmk.Name Exit For End If Next aBkmk If sRef = "" Then sRef = "xRef" & Format(Now(), "yyyymmddhhMMss") ActiveDocument.Bookmarks.Add sRef, aRng 'Create the XRef and add it immediately after the selection If Len(aRng.Text) > 0 Then sFieldCode = "Ref " & sRef & " \h" sPrefix = "" Else sFieldCode = "Ref " & sRef & " \h \n" sPrefix = "Section " End If Set aRng2 = aRng aRng2.Collapse Direction:=wdCollapseEnd Set aXRef = ActiveDocument.Fields.Add(aRng2, Text:=sFieldCode, PreserveFormatting:=False) aXRef.Select Set aRng = Selection.Range aRng.InsertBefore sPrefix aRng.Cut StatusBar = "Cross-reference copied to the clipboard. Paste away..." End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#11
|
|||
|
|||
Andrew - THANK YOU - THANK YOU! I didn't understand about the hidden bookmarks. It all makes sense now and everything works wonderfully. Unfortunately, I'm not able to create macros because our system is locked down pretty tight. Very unfortunate!!!! I'll talk to our System Admin to see if he will do it for me as it would be very helpful to see the bookmarks.
Again, thank you so much for taking the time to answer! |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Highlight numbers after a specific word in numbered list | liblikas90 | Word VBA | 3 | 02-27-2019 03:52 AM |
Problem with bold numbers in multi-level list styles when having numbered headings AND paragraphs | bwofficer | Word | 2 | 12-12-2014 12:21 AM |
Numbers in Numbered List Insist on Being Bold | peytontodd | Word | 2 | 09-19-2014 11:01 AM |
Word Mixing Numbered Headings with Numbered List | Tess0 | Word | 11 | 07-15-2014 05:25 AM |
Auto-Update Amended Page Numbers? | herbertp | Word | 5 | 02-01-2013 02:20 AM |