#1   Report Post  
Posted to microsoft.public.word.docmanagement
DavidSherwood DavidSherwood is offline
external usenet poster
 
Posts: 3
Default EndNotes

I would like to create EndNotes from a number list. The text already has
superscripts refering to these numbers. Is there a way to convert these to
EndNotes?
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default EndNotes

If the notes list is contained in a 2 column table saved as a document, then
the following macro will locate the superscripted number from the first
table column and replace it with an endnote reference containing the text
from the second column. The macro does not allow for multiple references to
the same endnote. Each number will be treated as a new end note.

Change the name of the document ("D:\My Documents\Word
Documents\EndNoteTable.doc") to reflect the path to your own table document.
http://www.gmayor.com/installing_macro.htm

Run the macro with the document to be annotated in view.
If you don't like the result, don't save the modified document!

Sub EndNotesFromList()
Dim oList As Document
Dim oDoc As Document
Dim oRng As Range
Dim oTable As Table
Dim oNum As Range
Dim oNote As Range
Set oDoc = ActiveDocument
Set oList = Documents.Open("D:\My Documents\Word
Documents\EndNoteTable.doc")
oDoc.Activate
Set oTable = oList.Tables(1)
For i = 1 To oTable.Rows.Count
Set oNum = oTable.Rows(i).Cells(1).Range
Set oNote = oTable.Rows(i).Cells(2).Range
oNum.End = oNum.End - 1
oNote.End = oNote.End - 1
With Selection
.HomeKey wdStory
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Font.Superscript = True
.MatchWildcards = True
Do While .Execute(oNum)
Set oRng = Selection.Range
oRng.Endnotes.Add oRng, , oNote.Text
oRng.Text = ""
Loop
End With
End With
Next i
End Sub


DavidSherwood wrote:
I would like to create EndNotes from a number list. The text already
has superscripts refering to these numbers. Is there a way to convert
these to EndNotes?



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
DavidSherwood DavidSherwood is offline
external usenet poster
 
Posts: 3
Default EndNotes

This almost worked. It doesn't handle 2 digit numbers. When it got to 10, it
repeated the first note and started picking random notes up to 24. But there
is only 17 notes.
  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default EndNotes

My fault I only tested with single digit numbers and the two parts of the
superscripted double digit number are treated as separate number entries. If
you reverse the search starting at the largerst number, it should be OK.
Note that the numbers that you have in the document will not match the
numbers in the end notes if the numbers are not entered consecutively, but
the references should now be correct.

Sub EndNotesFromList()
Dim oList As Document
Dim oDoc As Document
Dim oRng As Range
Dim oTable As Table
Dim oNum As Range
Dim oNote As Range
Set oDoc = ActiveDocument
Set oList = Documents.Open("D:\My Documents\Word
Documents\EndNoteTable.doc")
oDoc.Activate
Set oTable = oList.Tables(1)
For i = oTable.Rows.Count To 1 Step -1
Set oNum = oTable.Rows(i).Cells(1).Range
Set oNote = oTable.Rows(i).Cells(2).Range
oNum.End = oNum.End - 1
oNote.End = oNote.End - 1
With Selection
.HomeKey wdStory
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Font.Superscript = True
.MatchWildcards = True
Do While .Execute(oNum)
Set oRng = Selection.Range
oRng.Endnotes.Add oRng, , oNote.Text
oRng.Text = ""
Loop
End With
End With
Next i
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



DavidSherwood wrote:
This almost worked. It doesn't handle 2 digit numbers. When it got to
10, it repeated the first note and started picking random notes up to
24. But there is only 17 notes.



  #5   Report Post  
Posted to microsoft.public.word.docmanagement
DavidSherwood DavidSherwood is offline
external usenet poster
 
Posts: 3
Default EndNotes

Thanks. This version worked great.
Thanks a lot.


  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default EndNotes

You are welcome

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



DavidSherwood wrote:
Thanks. This version worked great.
Thanks a lot.



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Endnotes Rajkumar Microsoft Word Help 1 February 15th 08 12:53 PM
Endnotes Rajkumar Microsoft Word Help 0 February 7th 08 12:13 AM
Endnotes Rsrchr Microsoft Word Help 2 January 30th 08 10:40 PM
How do I convert chapter endnotes into book endnotes? Frustrated Secretary Microsoft Word Help 1 March 5th 06 04:57 PM
Help with endnotes Michel Microsoft Word Help 1 February 13th 05 01:26 AM


All times are GMT +1. The time now is 02:07 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"