View Single Post
 
Old 11-02-2015, 05:08 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,359
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You could use a macro like:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim i As Long
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = ""
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindStop
    .Format = True
    .Font.Italic = True
    .Execute
  End With
  Do While .Find.Found
    i = i + 1
    If .Characters.First = " " Then
      .Characters.First.Font.Italic = False
      .Start = .Start + 1
    End If
    .Characters.First.Previous.InsertBefore "§"
    If .Characters.Last = " " Then
      .Characters.Last.Font.Italic = False
      .End = .End - 1
    End If
    .Characters.Last.InsertAfter "@"
    .Characters.Last.Font.Italic = False
    .End = .End + 1
    'The next line is only needed if the Find is based on formatting without regard to text
    If .End = ActiveDocument.Range.End Then Exit Sub
    .Collapse wdCollapseEnd
    .Find.Execute
  Loop
End With
Application.ScreenUpdating = True
MsgBox i & " instances found."
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote