Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #13  
Old 07-12-2017, 06:32 PM
iwonder iwonder is offline How to change superscript footnotes into genuine Word footnotes Windows 10 How to change superscript footnotes into genuine Word footnotes Office 2013
Novice
 
Join Date: Jun 2017
Location: France
Posts: 10
iwonder is on a distinguished road
Default

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
Attached Files
File Type: doc testfile.doc (66.5 KB, 18 views)
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change superscript footnotes into genuine Word footnotes Word footnotes and track changes problem 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
How to change superscript footnotes into genuine Word footnotes word 2007 - footnotes and text box glggluig Word 1 08-10-2014 04:09 AM
How to change superscript footnotes into genuine Word footnotes Corrupted footnotes in Word mythander889 Word 12 09-11-2012 03:58 PM
How to change superscript footnotes into genuine Word footnotes Can Word automatically update footnotes? gib65 Word 2 08-15-2011 01:46 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:27 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft