set left-to-right for 1 line in the footer

4

4tis

hi
i am using a VBA code which manipulate some text line in the footer.
my problem is that the text is mixed with 2 language so, i need the
text to be "align left" and the "left-to-right" in the button.
my problem - i can make the text "align left" but cannot make it
"left-to-right"
the relevent code i am using is :

-------------------------------------------------------------------------------------------------------------------
Dim lngJunk As Long
Dim oStoryRange As Word.Range
Dim oFld As Field
lngJunk = ActiveDocument.Sections(1).Headers(1).Range.StoryType
For Each oStoryRange In ActiveDocument.StoryRanges
Select Case oStoryRange.StoryType
Case Is = 8, 9, 11
Do
With oStoryRange.Find
.MatchWildcards = True
.Text = "/*/*/[0-9]"
.Replacement.Text = "/àéúé/maui/3"
.Replacement.Font.Name = "Arial"
.Replacement.Font.Size = 10
.Replacement.Application.Selection.LtrPara
.Replacement.LanguageID = wdEnglishUS
.Replacement.ParagraphFormat.Alignment =
wdAlignParagraphLeft
' .Replacement.ParagraphFormat.TextDirection =
pbTextDirectionRightToLeft

.Execute Replace:=wdReplaceAll

If .Found = True Then

End If

End With

Set oStoryRange = oStoryRange.NextStoryRange
Loop Until oStoryRange Is Nothing
Case Else
'Do Nothing
End Select
Next
-----------------------------------------------------------------------------------------------------------------

the line ".Replacement.ParagraphFormat.TextDirection =
pbTextDirectionRightToLeft" is not working here because he is not
recognize the ".TextDirection" in the Range.

any idea what can i do ?
i am realy despert.
thank you in advanced
 
R

Russ

4tis,
See below.
hi
i am using a VBA code which manipulate some text line in the footer.
my problem is that the text is mixed with 2 language so, i need the
text to be "align left" and the "left-to-right" in the button.
my problem - i can make the text "align left" but cannot make it
"left-to-right"
the relevent code i am using is :

------------------------------------------------------------------------------
-------------------------------------
Dim lngJunk As Long
Dim oStoryRange As Word.Range
Dim oFld As Field
lngJunk = ActiveDocument.Sections(1).Headers(1).Range.StoryType
For Each oStoryRange In ActiveDocument.StoryRanges
Select Case oStoryRange.StoryType
Case Is = 8, 9, 11
Do
With oStoryRange.Find
.MatchWildcards = True
.Text = "/*/*/[0-9]"
.Replacement.Text = "/àéúé/maui/3"
.Replacement.Font.Name = "Arial"
.Replacement.Font.Size = 10
.Replacement.Application.Selection.LtrPara
.Replacement.LanguageID = wdEnglishUS
.Replacement.ParagraphFormat.Alignment =
wdAlignParagraphLeft
' .Replacement.ParagraphFormat.TextDirection =
pbTextDirectionRightToLeft

.Execute Replace:=wdReplaceAll

If .Found = True Then

End If

End With

Set oStoryRange = oStoryRange.NextStoryRange
Loop Until oStoryRange Is Nothing
Case Else
'Do Nothing
End Select
Next
------------------------------------------------------------------------------
-----------------------------------

the line ".Replacement.ParagraphFormat.TextDirection =
pbTextDirectionRightToLeft" is not working here because he is not
recognize the ".TextDirection" in the Range.

any idea what can i do ?
i am realy despert.
thank you in advanced
Have you tried recording a macro while manually switching languages and
doing what you want Word to do?
Link for Word info about features for right to languages:
http://office.microsoft.com/en-us/assistance/HP052585671033.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top