batch convert all footnotes to endnotes in multiple word files

Discussion in 'Microsoft Office' started by Rileyt, May 10, 2017.

  1. Rileyt

    Rileyt MDL Novice

    May 10, 2017
    1
    0
    0
    Hi,

    I have several word documents. As the standard of the format is changed, I have to convert all the footnotes to end notes in them.

    I know I can select “Convert all footnotes to endnotes” option in one word document to change it. But using this way, I have to do that one by one .

    Is there any quickly way to batch convert all footnotes to endnotes in multiple word files? Thanks!
     
  2. louisy

    louisy MDL Novice

    May 12, 2017
    1
    0
    0
    Hi,Rileyt

    To batch edit all word documents, may be you can use VBA. Here is a sample you can try:

    Code:
    Sub BatchConvertFootnotesToEndnotes()
      Dim objWordApplication As New Word.Application
      Dim strFile As String
      Dim strFolder As String
    
      strFolder = InputBox("Enter the folder address", "Folder Address", "For example:E:\test word\test\")
      strFile = Dir(strFolder & "*.doc*", vbNormal)
     
      While strFile <> ""
        With objWordApplication
          .Documents.Open (strFolder & strFile)
          .ActiveDocument.Footnotes.Convert
          .ActiveDocument.Close
        End With
        strFile = Dir()
      Wend
     
      Set objWordApplication = Nothing
     
    End Sub
    Hope it helps.