![]() |
|
#1
|
||||
|
||||
![]()
Did you compare the attachments in posts #1 & #8? You'll see from them that, if the instructions in post #2 are followed exactly, the process works as described.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#2
|
|||
|
|||
![]()
Paul, thanks for replying
I did follow your explainations, but in the test file sent by Knoute29, footnotes are gathered together, and yes, it works fine if selected in a row (altogether). But when notes are disseminated (scattered?) in the text (as they are in my converted files), i have to select them with the Ctrl key, and in that case, i found that it doesn't work Am I right ? |
#3
|
|||
|
|||
![]()
Below are the code and sample text used :
Did I made a mistake ? Code:
Sub ReLinkFootNotes() Dim i As Integer, j As Integer, k As Integer, l As Integer, FtRng As Range Application.ScreenUpdating = False With ActiveDocument Set FtRng = Selection.Range With FtRng .Style = "Note de bas de page" With .Find .ClearFormatting .Replacement.ClearFormatting ' Change '[' and ']' on the next line to whatever is appropriate if the selected ' footnotes' numbers are enclosed in characters other than square brackets .Text = "([0-9]{1;})" .Replacement.Text = "\1" .Forward = True .Wrap = wdFindStop .Format = False .MatchCase = False .MatchWholeWord = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = True .Execute Replace:=wdReplaceAll End With k = .Paragraphs(1).Range.Words(1) - 1 j = k l = ActiveDocument.Footnotes.Count - k For i = 1 To .Paragraphs.Count If .Paragraphs(i).Range.Words(1) = j + 1 Then j = j + 1 End If Next i End With For i = k + 1 To j StatusBar = "Finding Footnote Location: " & i + l With .Content.Find ' Change '"[" & i & "]"' string on the next line to whatever is appropriate ' if the in-line references are not enclosed in square brackets .Text = i ' Delete/comment out the next line if not applicable .Font.Superscript = True .MatchWholeWord = True .MatchWildcards = False .Execute If .Found = True Then .Parent.Select With Selection .Delete .Footnotes.Add Range:=Selection.Range, Text:="" End With End If End With Next i With FtRng For i = k + 1 To j StatusBar = "Transferring Footnote: " & i + l With .Paragraphs(1).Range .Cut With ActiveDocument.Footnotes(i + l).Range .Paste .Words(1).Delete .Characters.Last.Delete End With End With Next i On Error Resume Next End With Set FtRng = Nothing End With Application.ScreenUpdating = True End Sub |
#4
|
||||
|
||||
![]()
With footnotes, you can only process them on one page at a time (i.e. you can't select them across multiple pages) and you have to select the footnotes concerned for processing.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
![]()
Having spent a lot of time on your code, I'm 99% sure that a punctuation mark must precede the footnote calling number to make it correctly work.
"This is a sentence.1 This" will work "This is a word1 followed by the rest of the sentence." will not work I read many English text where the footnote calling number is located at the end of a sentence, just after the period. Maybe this is a rule of thumb in English typography. (Is it ?) But in my native language, it is not ; footnote calling numbers can be anywhere in a sentence. |
#6
|
||||
|
||||
![]()
Well, it was you who wrote:
And that complaint has nothing to do with my code. Accordingly, it can only be understood as an unwarranted criticism or a complete irrelevance. You choose.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Carnegie | Word | 14 | 03-13-2017 01:31 AM |
Convert manual cross references in footnotes to other footnotes to automatic cross references | ghumdinger | Word VBA | 7 | 11-20-2014 11:47 PM |
![]() |
glggluig | Word | 1 | 08-10-2014 04:09 AM |
![]() |
mythander889 | Word | 12 | 09-11-2012 03:58 PM |
![]() |
gib65 | Word | 2 | 08-15-2011 01:46 PM |