View Single Post
 
Old 07-15-2019, 05:23 AM
JohnWilson JohnWilson is offline Windows 10 Office 2016
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

Not easy!

Here's a possible start for you to work on if you have multiple quotes in one textframe you will need to work on the pattern.

Code:
Sub regxz()

Dim oMatches As Object
Dim i As Long
Dim otr As TextRange2
Dim osld As Slide
Dim oshp As Shape
Dim regX As Object
Dim strmatch As String
Set regX = CreateObject("VBScript.RegExp")

' this allows for smart curly quotes but do not mix smart and straight
strmatch = "[" & Chr(147) & "," & Chr(34) & "]" & ".*" & "[" & Chr(148) & "," & Chr(34) & "]"
For Each osld In ActivePresentation.Slides
For Each oshp In osld.Shapes
If oshp.HasTextFrame Then
If oshp.TextFrame2.HasText Then Set otr = oshp.TextFrame2.TextRange
On Error Resume Next
With regX
    .Global = True
    .IgnoreCase = True
    .Pattern = strmatch
    Set oMatches = .Execute(otr)
    For i = 0 To oMatches.Count - 1
       otr.Characters(oMatches(i).FirstIndex + 1, Len(oMatches(i).Value)).Font.Italic = True
    Next i
End With
End If
Next oshp
Next osld
End Sub
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote