You can't use autoformat in the notes themselves, but you can copy the notes to a document, format them there then copy them back again. The following should work
With a few small modifications to that code you should also be able to use it with http://www.gmayor.com/document_batch_processes.htm as a custom process to enable you to batch process your documents.Option Explicit Sub LinkNotes() Dim oDoc As Document Dim oTemp As Document Dim oNote As Range Dim oFN As Footnote Dim oEN As EndNote Dim oRng As Range Set oDoc = ActiveDocument oDoc.Save Set oTemp = Documents.Add(Template:=oDoc.FullName, Visible:=False) For Each oFN In oDoc.Footnotes Set oNote = oFN.Range Set oRng = oTemp.Range oRng.FormattedText = oNote.FormattedText oRng.Style = "Footnote Text" Options.AutoFormatReplaceHyperlinks = True oRng.AutoFormat oRng.End = oRng.End - 1 oNote.FormattedText = oRng.FormattedText Next oFN For Each oEN In oDoc.Endnotes Set oNote = oEN.Range Set oRng = oTemp.Range oRng.FormattedText = oNote.FormattedText oRng.Style = "Footnote Text" Options.AutoFormatReplaceHyperlinks = True oRng.AutoFormat oRng.End = oRng.End - 1 oNote.FormattedText = oRng.FormattedText Next oEN oTemp.Close savechanges:=wdDoNotSaveChanges lbl_Exit: Set oEN = Nothing Set oFN = Nothing Set oDoc = Nothing Set oTemp = Nothing Set oRng = Nothing Set oNote = Nothing Exit Sub End Sub
Option Explicit Function LinkNotes(oDoc As Document) As Boolean Dim oTemp As Document Dim oNote As Range Dim oFN As Footnote Dim oEN As EndNote Dim oRng As Range On Error GoTo err_Handler Set oTemp = Documents.Add(Template:=oDoc.FullName, Visible:=False) For Each oFN In oDoc.Footnotes Set oNote = oFN.Range Set oRng = oTemp.Range oRng.FormattedText = oNote.FormattedText oRng.Style = "Footnote Text" Options.AutoFormatReplaceHyperlinks = True oRng.AutoFormat oRng.End = oRng.End - 1 oNote.FormattedText = oRng.FormattedText Next oFN For Each oEN In oDoc.Endnotes Set oNote = oEN.Range Set oRng = oTemp.Range oRng.FormattedText = oNote.FormattedText oRng.Style = "Footnote Text" Options.AutoFormatReplaceHyperlinks = True oRng.AutoFormat oRng.End = oRng.End - 1 oNote.FormattedText = oRng.FormattedText Next oEN oTemp.Close savechanges:=wdDoNotSaveChanges LinkNotes = True lbl_Exit: Set oEN = Nothing Set oFN = Nothing Set oDoc = Nothing Set oTemp = Nothing Set oRng = Nothing Set oNote = Nothing Exit Function err_Handler: LinkNotes = False Resume lbl_Exit End Function




Reply With Quote
