I'm using the below macro:
Sub hhh()
Dim oSld As Slide
Dim oShp As Shape
On Error Resume Next
Set oSld = ActiveWindow.View.Slide
For Each oShp In oSld.Shapes
'-------------------------- Table --------------------------
If oShp.HasTable Then
Call r2LTable(oShp.Table)
End If
End Sub
Sub r2LTable(otbl As Table)
Dim iRow As Integer
Dim iCol As Integer
Dim L As Long
For iRow = 1 To otbl.Rows.Count
For iCol = 1 To otbl.Columns.Count
With otbl.Cell(iRow, iCol).Shape.TextFrame.TextRange
.Font.Name = "Arial"
.Font.NameComplexScript = "Arial"
.ParagraphFormat.TextDirection = ppDirectionRightToLeft
.RtlRun
If .ParagraphFormat.Alignment = ppAlignLeft Then
.ParagraphFormat.Alignment = ppAlignRight
End If
If CharType(.Characters(L)) = "English" Then
With .Characters(L)
.LanguageID = msoLanguageIDEnglishUS
End With
ElseIf CharType(.Characters(L)) = "Space" Then
'If CharType(.Characters(L - 1)) = "English" And CharType(.Characters(L + 1)) = "English" Then
With .Characters(L)
'.Font.Underline = -4119
.LanguageID = msoLanguageIDEnglishUS
End With
'End If
End If
Next L
End With
Next iCol
Next iRow
End Sub
It didn't work until i comment this line:
'If CharType(.Characters(L - 1)) = "English" And CharType(.Characters(L + 1)) = "English" Then
!!!!!!!!
any explanations ?
Private Function CharType(Letter As String) As String
Select Case AscW(Letter)
Case 32
CharType = "Space"
Case 48 To 57 '0-9
CharType = "English"
Case 65 To 90 'A-Z
CharType = "English"
Case 97 To 122 'a-z
CharType = "English"
Case 174 '®
CharType = "English"
Case 8482 '™
CharType = "English"
Case 169 '©
CharType = "English"
Case 44 ',
CharType = "English"
Case 64 '@
CharType = "English"
End Select
End Function