View Single Post
 
Old 09-26-2023, 09:09 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,164
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Try this
Code:
Sub Macro1()
  Dim aRng As Range, iType As Integer
  On Error GoTo EndSub    'footnotes story may not exist in all docs
  For iType = 1 To 2
    Set aRng = ActiveDocument.StoryRanges(iType)   'wdMainTextStory = 1, wdFootnotesStory = 2
    With aRng.Find
      .ClearFormatting
      .Replacement.ClearFormatting
      .Text = ""
      .Replacement.Text = ""
      .Font.Italic = True
      .Replacement.Style = ActiveDocument.Styles("Emphasis")
      .Forward = True
      .Wrap = wdFindContinue
      .Format = True
      .MatchCase = False
      .MatchWholeWord = False
      .MatchKashida = False
      .MatchDiacritics = False
      .MatchAlefHamza = False
      .MatchControl = False
      .MatchWildcards = False
      .MatchSoundsLike = False
      .MatchAllWordForms = False
      .Execute Replace:=wdReplaceAll
    End With
  Next iType
EndSub:
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote