#1
|
|||
|
|||
Changing english numerals to arabic numerals
Dear all,
I have two sided page layout, the left side is for english and the right side is for arabic. i want to display right side i.e Arabic words and the numerals also in arabic . The left side english and english / Roman numerals. I went through some advanced options but it changed entire english numeral to arabic in single page. rgds, aligahk06 |
#2
|
|||
|
|||
ok i think this will do it - 'different odd & even pages' for your footers
odd page footer page numbering page \* roman even page footer page numbering page \* arabic also, take a look at this How to control the page numbering in a Word document |
#3
|
|||
|
|||
Quote:
Please help . |
#4
|
||||
|
||||
The following two macros convert numbers in the selected range between Western and Arabic/Persian. The code also provides for numbers written left-to-right and for right-to-left - the supplied function does the reversing. Comments in the code show how to change the text direction and which source/target scripts to use.
For PC macro installation & usage instructions, see: Installing Macros For Mac macro installation & usage instructions, see: Word:mac - Install a Macro Code:
Sub WesternNumberToArabic_or_Persian() Dim Rng As Range, StrTmp As String, i As Long Set Rng = Selection.Range With Selection.Range With .Find .ClearFormatting .Forward = True .Wrap = wdFindStop .Format = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = True .MatchSoundsLike = False .MatchAllWordForms = False .Text = "[,.0-9]{1,}" .Replacement.Text = "" End With Do While .Find.Execute If .InRange(Rng) = False Then Exit Sub If .Characters.Last Like "[.,]" Then .End = .End - 1 ' If the numbers are input right-to-left, use: StrTmp = Reverse(.Text) ' If the numbers are input left-to-right, use: StrTmp = .Text For i = 0 To 9 ' For arabic #s, use StrTmp = Replace(StrTmp, Chr(48 + i), ChrW(17632 + i)) ' For persian #s, use StrTmp = Replace(StrTmp, Chr(48 + i), ChrW(1776 + i)) Next i .Text = StrTmp .Collapse (wdCollapseEnd) Loop End With End Sub Code:
Sub Arabic_or_PersianNumberToWestern() Dim Rng As Range, StrTmp As String, i As Long Set Rng = Selection.Range With Selection.Range With .Find .ClearFormatting .Forward = True .Wrap = wdFindStop .Format = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = True .MatchSoundsLike = False .MatchAllWordForms = False 'For arabic #s, use: .Text = "[,." & ChrW(1632) & "-" & ChrW(1641) & "]{1,}" 'For persian #s, use .Text = "[,." & ChrW(1776) & "-" & ChrW(1785) & "]{1,}" .Replacement.Text = "" End With Do While .Find.Execute If .InRange(Rng) = False Then Exit Sub If .Characters.Last Like "[.,]" Then .End = .End - 1 ' If the numbers are input right-to-left, use: StrTmp = Reverse(.Text) ' If the numbers are input left-to-right, use: StrTmp = .Text For i = 0 To 9 ' For arabic #s, use 1632 StrTmp = Replace(StrTmp, ChrW(1632 + i), Chr(48 + i)) ' For persian #s, use 1776 StrTmp = Replace(StrTmp, ChrW(1776 + i), Chr(48 + i)) Next i .Text = StrTmp .Collapse (wdCollapseEnd) Loop End With End Sub Code:
Function Reverse(StrTmp As String) As String If (Len(StrTmp) > 1) Then Reverse = Reverse(Mid$(StrTmp, 2)) + Left$(StrTmp, 1) Else Reverse = StrTmp End If End Function
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Microsoft Word 2013 Pagination with Roman numerals and Numbers on same document | jeolex | Word | 1 | 11-11-2016 07:28 AM |
Changing numerals to red in one operation | oldyeller38 | Word | 10 | 04-27-2015 04:09 AM |
Converting Roman to Aribic numerals using a list style | Sigmoid | Word | 2 | 10-16-2014 06:11 AM |
TOC stuck eith Roman numerals | SQLUSA | Word | 5 | 08-26-2012 05:19 AM |
Bold numerals whilst typing normally! | ianl1532 | Word | 2 | 02-20-2012 10:20 PM |