Forum Discussion
Numbering with Gujarati Numbers.
- Mar 20, 2023
mehulchanpura Unfortunately, all that I can suggest is that you request the facility be added via the Feedback facility under Help. While that may not help you with the current book, such numbering might be available for a future book.
In the meantime, if you used one of the available numbering systems and then set up an Excel workbook with those numbers in Column A of Sheet 1 and the corresponding Gujarati numbers in Column B and then when finished your book you ran a macro containing the following code, it will ask you to select the workbook containing the numbers and then replace the numbers used in the document with their Gujarati equivalents. (I would suggest running it on a copy of the document so that your original remains intact, just in case the result is not as expected).
Dim FD As FileDialog Dim strWorkbook As String Set FD = Application.FileDialog(msoFileDialogFilePicker) With FD .Title = "Select the Workbook containing the numbers." .Filters.Clear .Filters.Add "Excel Files", "*.xlsx" .AllowMultiSelect = False If .Show = -1 Then strWorkbook = .SelectedItems(1) Else MsgBox "You did not select a file." Exit Sub End If End With Dim xlapp As Object Dim xlbook As Object Dim xlsheet As Object Dim myarray As Variant On Error Resume Next Set xlapp = GetObject(, "Excel.Application") If Err Then bstartApp = True Set xlapp = CreateObject("Excel.Application") End If On Error GoTo 0 Set xlbook = xlapp.Workbooks.Open(strWorkbook) Set xlsheet = xlbook.Worksheets(1) myarray = xlsheet.Range("A1").CurrentRegion.Value xlbook.Close If bstartApp = True Then xlapp.Quit End If Set xlapp = Nothing Set xlbook = Nothing Set xlsheet = Nothing ActiveDocument.ConvertNumbersToText For i = 2 To UBound(myarray) Selection.HomeKey wdStory Selection.Find.ClearFormatting With Selection.Find .Text = myarray(i, 1) .Replacement.Text = myarray(i, 2) .MatchWildcards = False .Wrap = wdFindContinue .MatchCase = False End With Selection.Find.Execute Replace:=wdReplaceAll Next i
Thanks again.
mehulchanpura The macro will change the English numbers to their Gujarati equivalents.
This statement:
"I still have to replace that numbers which are in English to Gujarati."
is not correct.