![]() |
#1
|
|||
|
|||
![]()
I imported into Word a large text document that has over a 1000 endnotes. The endnotes restart the numbering at the beginning of each chapter. Is there a way I can convert the text endnotes to actual linked endnotes? As a start I replaced all the existing endnote numbers that exist in the body of the document with red formatting so the endnote numbers are easily findable, hopefully. I'd like to do a find all RED numbers and replace them with an endnote marker in a manner similar to using ^p for paragraphs, but there is none that I can find.
I have Office 2011 on a Mac. |
#2
|
||||
|
||||
![]()
Hi Dickison,
Yes, it's quite possible with a macro, though I'm not sure making the numbers red will make much difference. The important point is that each endnote should consist of a single paragraph (I've done this before). Can you post an extract from the document containing some representative data (delete anything sensitive)? You do this via the paperclip symbol on the 'Go Advanced' tab.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Document attached with representative data.
|
#4
|
||||
|
||||
![]()
Try the following macro.
Code:
Sub ReLinkEndNotes() Dim i As Long, j As Long, NtRng As Range, Rng As Range, StrNt As String Application.ScreenUpdating = False With ActiveDocument Set NtRng = Selection.Range Set Rng = .Range Rng.End = NtRng.Start With NtRng .ListFormat.ConvertNumbersToText .Style = "Endnote Text" With .Find .ClearFormatting .Text = "([0-9]{1,}).^t" With .Replacement .ClearFormatting .Text = "\1 " End With .Forward = True .Wrap = wdFindStop .Format = False .MatchCase = False .MatchWholeWord = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = True .Execute Replace:=wdReplaceAll End With For i = 1 To .Paragraphs.Count If IsNumeric(Trim(.Paragraphs(i).Range.Words(1))) Then With .Paragraphs(i).Range j = Trim(.Words(1)) StatusBar = "Creating Endnote: " & j .Start = .Start + Len(j) .End = .End - 1 StrNt = .Text .Delete End With With Rng.Find .Text = j .Format = True .Font.ColorIndex = wdRed .MatchWholeWord = True .MatchWildcards = False .Execute If .Found = True Then .Parent.Select With Selection .Text = vbNullString .Endnotes.Add Range:=Selection.Range, Text:=StrNt End With Rng.Start = .Parent.Start End If End With End If Next i .Delete End With End With Set NtRng = Nothing: Set Rng = Nothing Application.ScreenUpdating = True End Sub For PC macro installation & usage instructions, see: Installing Macros For Mac macro installation & usage instructions, see: Word:mac - Install a Macro
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
![]()
Thanks. I'll let you know how it goes. I have to do some more editing on the main document first then I'll give it a try.
|
![]() |
Tags |
endnotes |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
kenglade | Word | 22 | 09-14-2012 04:10 PM |
![]() |
elias | Word | 12 | 09-04-2012 04:12 PM |
![]() |
Boatwrenchv8 | Word | 3 | 05-17-2012 04:56 PM |
combining word documents with endnotes | mikelee114 | Word | 1 | 04-08-2012 05:27 AM |
![]() |
Brent | Word | 5 | 02-01-2011 03:15 PM |