Reputation: 355
Complete novice. I created a Word document using Pandoc but the Arabic output required some modification. Scraping through online documentation and posts, I have got the following code:
Sub pandoc_RTL()
'
' pandoc_RTL Macro
'
'
Dim objPara As Paragraph
For Each objPara In ActiveDocument.Paragraphs
If objPara.Style = "body AR" Then
objPara.Range.Select
Selection.RtlRun
Selection.RtlPara
End If
If objPara.Style = "hadith AR" Then
objPara.Range.Select
Selection.RtlRun
Selection.RtlPara
End If
If objPara.Style = "hadith in-list AR" Then
objPara.Range.Select
Selection.RtlRun
Selection.RtlPara
End If
If objPara.Style = "athar AR" Then
objPara.Range.Select
Selection.RtlRun
Selection.RtlPara
End If
If objPara.Style = "body AR" Then
objPara.Range.Select
Selection.RtlRun
Selection.RtlPara
End If
Next
End Sub
My questions:
Upvotes: 0
Views: 131
Reputation: 13515
You need only modify the Styles. The radio buttons for this are accessible via Manage Styles>Modify>Format>Paragraph>Indents and Spacing in any document for which an RTL language has been enabled. In any event, using VBA:
Dim i As Long, ArrStl
ArrStl = Array("body AR", "hadith AR", "hadith in-list AR", "athar AR")
For i = 0 To UBound(ArrStl)
ActiveDocument.Styles(ArrStl(i)).ParagraphFormat.ReadingOrder = wdReadingOrderRtl
Next
Done.
Upvotes: 1