Tech Support Forum banner
Status
Not open for further replies.
1 - 5 of 5 Posts

· Registered
Joined
·
17 Posts
Discussion Starter · #1 · (Edited)
Hi all,

i have lot of word documents changed form LTR to RTL language
and i was thinking if i can find a macro can in every section; (not all document) change layout's section direction from "Left-to-right" to "Right-to-left"



And in Margins tab; reverse "Left" and "Right" values then makes Gutter position from "Left" to "Right".




Thanks in advance
 

· Moderator , Microsoft Support, MS Office Pro
Joined
·
2,557 Posts
Try:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim Sctn As Section, sngMargin As Single
With ActiveDocument
  For Each Sctn In .Sections
    With Sctn.PageSetup
      If .SectionDirection = wdSectionDirectionLtr Then
        .SectionDirection = wdSectionDirectionRtl
        sngMargin = .LeftMargin
        .LeftMargin = .RightMargin
        .RightMargin = sngMargin
        .GutterPos = wdGutterPosLeft
      End If
    End With
  Next
End With
Application.ScreenUpdating = True
End Sub
PS: I've merged your two threads. Please don't start multiple threads on such closely related issues.
 

· Registered
Joined
·
17 Posts
Discussion Starter · #4 ·
Dear Paul,

thanks for your swift help and response and sorry for duplicated topics, you macro is working so great

would you please to find some learning PDFs for VBA in word

Thanks for your help again
 
1 - 5 of 5 Posts
Status
Not open for further replies.
Top