#1
|
|||
|
|||
Macro for microsoft Word
Hello Everyone!
I would like to create macro for converting Cyrillic alphabet to Roman. Could you please give me any helpful information regarding this? Thank you in advice. |
#2
|
||||
|
||||
Given that the two alphabets are rather different, what do you mean when you say you want to convert one to the other?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
||||
|
||||
Cross-posted at: http://www.techsupportforum.com/foru...rd-647440.html
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
|||
|
|||
Hi again,
Yes, they are different. Is this possible to create macro which will convert Cyrillic to Roman alphabet? Thanks |
#5
|
||||
|
||||
you still haven't answered my question:
Quote:
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
Sorry but it's little bit funny question : )
Text what will be in word document I want to convert to Roman. This is the reason why I want to create macro which will find Cyrillic alphabet and replace it to Roman. What's difficult here to understand? : ( |
#7
|
|||
|
|||
There is not a one-to-one conversion. Letters in the two alphabets do not necessarily have an equivalent in the other, otherwise, you could simply change languages and fonts.
|
#8
|
||||
|
||||
Quote:
As there is more than one Cyrillic alphabet (26, actually, see: http://en.wikipedia.org/wiki/Cyrilli...#Summary_table), you'd need to clarify which one you want to convert also. Then there is the problem of what each character should be converted to. For example, I have no idea what 'ж' should be represented as. According to the 'Romanization' discussion here (http://en.wikipedia.org/wiki/Cyrilli...t#Romanization) there are also at least seven different systems for Romanizing the Cyrillic alphabet. You would have to choose the systme that suits your needs. If you pick a simple Romanization system, it might require nothing more that a sequential Find/Replace operation in which each Cyrillic character (or a group of Cyrillic chracters) is replaced with one or more Roman characters. If that's all you require, a simple Word table could be used to hold the Find/Replace character list. For that, create a suitable two-column table with the Cyrillic chracters in the first column and the Roman characters in the second, add the following macro to the document, then run it. All you'll need to do is to select the document to process when prompted by the macro. Code:
Sub Romanize() Application.ScreenUpdating = True Dim i As Long, Rng As Range, FRTbl As Table If Application.Dialogs(wdDialogFileOpen).Show <> -1 Then Exit Sub If ActiveDocument = ThisDocument Then Exit Sub Set FRTbl = ThisDocument.Tables(1) For i = 2 To FRTbl.Rows.Count With ActiveDocument.Range.Find .ClearFormatting Set Rng = FRTbl.Rows(i).Cells(1).Range Rng.End = Rng.End - 1 .Text = Rng.Text .Replacement.ClearFormatting Set Rng = FRTbl.Rows(i).Cells(2).Range Rng.End = Rng.End - 1 .Replacement.Text = Rng.Text .MatchWholeWord = False .MatchCase = False .Wrap = wdFindStop .Execute Replace:=wdReplaceAll End With Next Set FRTbl = Nothing Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
microsoft word | dells2711 | Word | 4 | 01-04-2012 10:41 AM |
Macro - Microsoft Word 2010 | OfficeHelpSG | Word | 3 | 10-18-2011 11:54 AM |
drawing in microsoft word | 951Michael | Drawing and Graphics | 1 | 04-29-2011 10:53 PM |
Please help with a macro in Microsoft Word 2007 | AKMMS | Word VBA | 0 | 06-23-2010 02:16 PM |
Microsoft Word 1997 | tightline | Word | 0 | 08-03-2009 11:15 AM |