Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Hebrew / right-to-left text
I am so close...the Hebrew text I am inserting into my English document has a
couple of glitches left. I'm wondering if there is a utility I can use. I've already installed a Hebrew keyboard, which fixed almost everything. The last two problems: 1. When I insert a bit of Hebrew into the middle of a paragraph, I then block out that Hebrew text and hit the "right-to-left" icon. But instead of applying it to the Hebrew, it applies it to the entire paragraph. 2. The punctuation is drifting. For instance, if there is a colon, instead of it being attached to the previous letter, it attaches to the next letter, after the space. So it looks sort of like this :with the colon. I can't just reverse the space and colon, because if I delete the space, the "s" deletes also. If I delete the colon, the "w" deletes also. Any guidance? -- Terri |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Hebrew / right-to-left text
1. What do you mean by "block out"? If the Hebrew text has been typed
with a proper Unicode Hebrew font, it should behave exactly as it needs to -- this week I've been typing Arabic words in the middle of German text, and all is well. The paragraph remains left-to-right, because that's the direction of your main text. (If you wanted an English word in the middle of a Hebrew paragraph, you wouldn't switch the paragraph to left-to-rignt.) 2. I did warn you that funny things happen at the interface. The most practical way to deal with stray punctuation is to select the wrong items and then press Backspace or Delete (or Ctrl-X), not to try just deleting them. The most practical way to insert punctuation at an interface is to type some spaces, put the colon or whatever in the middle of them, and select, then delete, the spaces that are in the wrong place. (If you type the punctuation while you're typing the text, there's no problem, but since you're inserting rather than typing, you'll encounter finicky behavior.) I don't know why adjacent characters are deleting, but if you select the space or colon and then delete, it probably won't happen. On Oct 9, 7:08*pm, Terri N wrote: I am so close...the Hebrew text I am inserting into my English document has a couple of glitches left. *I'm wondering if there is a utility I can use.. * I've already installed a Hebrew keyboard, which fixed almost everything. *The last two problems: 1. *When I insert a bit of Hebrew into the middle of a paragraph, I then block out that Hebrew text and hit the "right-to-left" icon. *But instead of applying it to the Hebrew, it applies it to the entire paragraph. 2. *The punctuation is drifting. *For instance, if there is a colon, instead of it being attached to the previous letter, it attaches to the next letter, after the space. *So it looks sort of like this * :with the colon. *I can't just reverse the space and colon, because if I delete the space, the "s" deletes also. *If I delete the colon, the "w" deletes also. Any guidance? -- Terri |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Hebrew / right-to-left text
I selected the Hebrew phrase, then chose right-to-left (RTL), hoping that
only the phrase itself would read RTL, per my customer's request. But the entire paragraph switched to RTL. So Word can't switch just the phrase? And you're saying that if you're typing a left-to-right English paragraph, the Hebrew phrase in the middle of it is going to have to read left to right as well? I'm having a hard time locating a Unicode Hebrew font--does a font that supports all the Hebrew characters (including vowels) come with Windows? I may be missing it. There is a font called "David" on my list. The person who will be typing the text is using a Mac, and I'll then have to paste it into my Word document and convert it to whatever font I'll be using. I found one online called Ezra that the customer likes, but it doesn't mention Unicode in the name. Thank you for the hint the punctuation. I've tried it with a little success in a couple of spots, and I'll keep trying and see if I can get the hang of it. Thanks for your help, Peter...this job is a huge challenge for me. But, as with most problems, I'm also learning a lot. -- Terri "Peter T. Daniels" wrote: 1. What do you mean by "block out"? If the Hebrew text has been typed with a proper Unicode Hebrew font, it should behave exactly as it needs to -- this week I've been typing Arabic words in the middle of German text, and all is well. The paragraph remains left-to-right, because that's the direction of your main text. (If you wanted an English word in the middle of a Hebrew paragraph, you wouldn't switch the paragraph to left-to-rignt.) 2. I did warn you that funny things happen at the interface. The most practical way to deal with stray punctuation is to select the wrong items and then press Backspace or Delete (or Ctrl-X), not to try just deleting them. The most practical way to insert punctuation at an interface is to type some spaces, put the colon or whatever in the middle of them, and select, then delete, the spaces that are in the wrong place. (If you type the punctuation while you're typing the text, there's no problem, but since you're inserting rather than typing, you'll encounter finicky behavior.) I don't know why adjacent characters are deleting, but if you select the space or colon and then delete, it probably won't happen. On Oct 9, 7:08 pm, Terri N wrote: I am so close...the Hebrew text I am inserting into my English document has a couple of glitches left. I'm wondering if there is a utility I can use.. I've already installed a Hebrew keyboard, which fixed almost everything. The last two problems: 1. When I insert a bit of Hebrew into the middle of a paragraph, I then block out that Hebrew text and hit the "right-to-left" icon. But instead of applying it to the Hebrew, it applies it to the entire paragraph. 2. The punctuation is drifting. For instance, if there is a colon, instead of it being attached to the previous letter, it attaches to the next letter, after the space. So it looks sort of like this :with the colon. I can't just reverse the space and colon, because if I delete the space, the "s" deletes also. If I delete the colon, the "w" deletes also. Any guidance? -- Terri |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Hebrew / right-to-left text
On Oct 10, 2:13*am, Terri N wrote:
I selected the Hebrew phrase, then chose right-to-left (RTL), hoping that only the phrase itself would read RTL, per my customer's request. *But the entire paragraph switched to RTL. *So Word can't switch just the phrase? *And you're saying that if you're typing a left-to-right English paragraph, the Hebrew phrase in the middle of it is going to have to read left to right as well? Of course not. Are you in fact not using a Unicode Hebrew font? If you're using a Hebrew font that just puts the letters in the a-z, A-Z etc. slots, then yes, you have to type backwards. But then you might as weill just type transliterations of the Hebrew! I'm having a hard time locating a Unicode Hebrew font--does a font that supports all the Hebrew characters (including vowels) come with Windows? *I may be missing it. *There is a font called "David" on my list. Fonts with the full complement of Hebrew characters include Arial, Tahoma, and Times New Roman. Fonts intended for Modern Hebrew, such as David, don't have the accents (cantillation marks) used only in Bible texts. But David _is_ a Unicode font (it came with either Windows or Office, since the only Hebrew I ever downloaded was SBL Hebrew, which is made especially for typing all the complicated stuff in the Bible text). The person who will be typing the text is using a Mac, and I'll then have to paste it into my Word document and convert it to whatever font I'll be using. *I found one online called Ezra that the customer likes, but it doesn't mention Unicode in the name. If it comes in different versions for Mac and Windows, then it probably isn't a Unicode font. Possibly if you hunt around you can find a version of Ezra that's been Unicode-encoded. Ah -- Ezra is from the SIL, so it's free; it is Unicode; and it has the full set of characters. It looks like the type found in early-20th- century Conservative prayer books. (And a lot of the Haggadahs you'll find next March.) Thank you for the hint the punctuation. *I've tried it with a little success in a couple of spots, and I'll keep trying and see if I can get the hang of it. Thanks for your help, Peter...this job is a huge challenge for me. *But, as with most problems, I'm also learning a lot. -- Terri "Peter T. Daniels" wrote: 1. What do you mean by "block out"? If the Hebrew text has been typed with a proper Unicode Hebrew font, it should behave exactly as it needs to -- this week I've been typing Arabic words in the middle of German text, and all is well. The paragraph remains left-to-right, because that's the direction of your main text. (If you wanted an English word in the middle of a Hebrew paragraph, you wouldn't switch the paragraph to left-to-rignt.) 2. I did warn you that funny things happen at the interface. The most practical way to deal with stray punctuation is to select the wrong items and then press Backspace or Delete (or Ctrl-X), not to try just deleting them. The most practical way to insert punctuation at an interface is to type some spaces, put the colon or whatever in the middle of them, and select, then delete, the spaces that are in the wrong place. (If you type the punctuation while you're typing the text, there's no problem, but since you're inserting rather than typing, you'll encounter finicky behavior.) I don't know why adjacent characters are deleting, but if you select the space or colon and then delete, it probably won't happen. On Oct 9, 7:08 pm, Terri N wrote: I am so close...the Hebrew text I am inserting into my English document has a couple of glitches left. *I'm wondering if there is a utility I can use.. * I've already installed a Hebrew keyboard, which fixed almost everything. *The last two problems: 1. *When I insert a bit of Hebrew into the middle of a paragraph, I then block out that Hebrew text and hit the "right-to-left" icon. *But instead of applying it to the Hebrew, it applies it to the entire paragraph. 2. *The punctuation is drifting. *For instance, if there is a colon, instead of it being attached to the previous letter, it attaches to the next letter, after the space. *So it looks sort of like this * :with the colon.. *I can't just reverse the space and colon, because if I delete the space, the "s" deletes also. *If I delete the colon, the "w" deletes also. Any guidance? -- Terri- |
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Hebrew / right-to-left text
Peter T. Daniels wrote:
IF you're using a Hebrew font that just puts the letters in the a-z, A-Z etc. slots, then yes, you have to type backwards. If the font requires that the text is typed backwards (and I hasted to add I have no knowledge of right left languages) that can easily be fixed with a macro that will reverse the order of selected text eg Sub ReverseCharacters() Dim sText As String sText = Selection.Range.Text If Len(sText) 2 Then MsgBox "You must select at least 2 characters!", _ vbCritical, "Reverse Characters" Exit Sub End If For i = Len(sText) To 1 Step -1 Selection.TypeText Mid(sText, i, 1) Next i End Sub http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org |
#6
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Hebrew / right-to-left text
I agree with Peter - this should just work, assuming Hebrew support is
enabled and the text is marked as Hebrew. Also, I'm not sure just reversing text with a macro will deal with line breaks properly. -- Enjoy, Tony www.WordArticles.com "Graham Mayor" wrote in message ... Peter T. Daniels wrote: IF you're using a Hebrew font that just puts the letters in the a-z, A-Z etc. slots, then yes, you have to type backwards. If the font requires that the text is typed backwards (and I hasted to add I have no knowledge of right left languages) that can easily be fixed with a macro that will reverse the order of selected text eg Sub ReverseCharacters() Dim sText As String sText = Selection.Range.Text If Len(sText) 2 Then MsgBox "You must select at least 2 characters!", _ vbCritical, "Reverse Characters" Exit Sub End If For i = Len(sText) To 1 Step -1 Selection.TypeText Mid(sText, i, 1) Next i End Sub http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org |
#7
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Hebrew / right-to-left text
As Tony noted, line breaks will be a problem -- but also, if there's
more than one word, will it reverse each word independently, or do you need to type your whole clause backward, last-word-first? This would of course be most useful to make up for the most glaring omission in Word's editing tools since the very beginning (since lots of other DTP apps have it) -- "transpose two characters"! On Oct 10, 9:29*am, "Graham Mayor" wrote: Peter T. Daniels wrote: IF you're using a Hebrew font that just puts the letters in the a-z, A-Z etc. slots, then yes, you have to type backwards. If the font requires that the text is typed backwards (and I hasted to add I have no knowledge of right left languages) that can easily be fixed with a macro that will reverse the order of selected text eg Sub ReverseCharacters() Dim sText As String sText = Selection.Range.Text If Len(sText) 2 Then * * MsgBox "You must select at least 2 characters!", _ * * vbCritical, "Reverse Characters" * * Exit Sub End If For i = Len(sText) To 1 Step -1 * * Selection.TypeText Mid(sText, i, 1) Next i End Sub http://www.gmayor.com/installing_macro.htm -- Graham Mayor - *Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org |
#8
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Hebrew / right-to-left text
The macro simply re-orders the selected text from end to start as if you had
typed it backwards. I did not envisage using it for long texts, merely phrases inserted into an English document. However as I said I have no personal knowledge of left to right languages. As for transposing two selected characters, that macro would work, but I suspect the following refinement might suit the task better Sub Transpose() Dim sText As String sText = Selection.Range.Text If Len(sText) 2 Then MsgBox "You must select 2 characters!", _ vbCritical, "Transpose Characters" Exit Sub End If If Selection.Range.Characters(1).Case = 1 _ And Selection.Range.Characters(2).Case = 0 Then Selection.TypeText UCase(Mid(sText, 2, 1)) & _ LCase(Mid(sText, 1, 1)) Else Selection.TypeText Mid(sText, 2, 1) & _ Mid(sText, 1, 1) End If End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Peter T. Daniels wrote: As Tony noted, line breaks will be a problem -- but also, if there's more than one word, will it reverse each word independently, or do you need to type your whole clause backward, last-word-first? This would of course be most useful to make up for the most glaring omission in Word's editing tools since the very beginning (since lots of other DTP apps have it) -- "transpose two characters"! On Oct 10, 9:29 am, "Graham Mayor" wrote: Peter T. Daniels wrote: IF you're using a Hebrew font that just puts the letters in the a-z, A-Z etc. slots, then yes, you have to type backwards. If the font requires that the text is typed backwards (and I hasted to add I have no knowledge of right left languages) that can easily be fixed with a macro that will reverse the order of selected text eg Sub ReverseCharacters() Dim sText As String sText = Selection.Range.Text If Len(sText) 2 Then MsgBox "You must select at least 2 characters!", _ vbCritical, "Reverse Characters" Exit Sub End If For i = Len(sText) To 1 Step -1 Selection.TypeText Mid(sText, i, 1) Next i End Sub http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org |
#9
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
"Transpose" macro Hebrew / right-to-left text
Wow -- I don't think anyone's bothered to fix the _case_ where it's
involved in a transposition before! And Ctrl-T is the Hanging Indent shortcut -- which I always do with either the Ruler or the Paragraph Format tool, since anything automatic would have to be adjusted anyway,so it will have its own perfectly intuitive command! Thanks! Now to relocate the install-macro instructions ... On Oct 11, 2:02*am, "Graham Mayor" wrote:. As for transposing two selected characters, that macro would work, but I suspect the following refinement might suit the task better Sub Transpose() Dim sText As String sText = Selection.Range.Text If Len(sText) 2 Then * * MsgBox "You must select 2 characters!", _ * * vbCritical, "Transpose Characters" * * Exit Sub End If If Selection.Range.Characters(1).Case = 1 _ And Selection.Range.Characters(2).Case = 0 Then * * Selection.TypeText UCase(Mid(sText, 2, 1)) & _ * * LCase(Mid(sText, 1, 1)) Else * * Selection.TypeText Mid(sText, 2, 1) & _ * * Mid(sText, 1, 1) End If End Sub -- Graham Mayor - *Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org |
#10
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
"Transpose" macro Hebrew / right-to-left text
http://www.gmayor.com/installing_macro.htm
-- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Peter T. Daniels wrote: Wow -- I don't think anyone's bothered to fix the _case_ where it's involved in a transposition before! And Ctrl-T is the Hanging Indent shortcut -- which I always do with either the Ruler or the Paragraph Format tool, since anything automatic would have to be adjusted anyway,so it will have its own perfectly intuitive command! Thanks! Now to relocate the install-macro instructions ... On Oct 11, 2:02 am, "Graham Mayor" wrote:. As for transposing two selected characters, that macro would work, but I suspect the following refinement might suit the task better Sub Transpose() Dim sText As String sText = Selection.Range.Text If Len(sText) 2 Then MsgBox "You must select 2 characters!", _ vbCritical, "Transpose Characters" Exit Sub End If If Selection.Range.Characters(1).Case = 1 _ And Selection.Range.Characters(2).Case = 0 Then Selection.TypeText UCase(Mid(sText, 2, 1)) & _ LCase(Mid(sText, 1, 1)) Else Selection.TypeText Mid(sText, 2, 1) & _ Mid(sText, 1, 1) End If End Sub -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org |
#11
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
"Transpose" macro Hebrew / right-to-left text
I should Bookmark that in my browser ...
One other thing (I hoped to add this before you saw the thread again!): can you make it work on two characters that the cursor is between, rather than having to select the two characters? On Oct 11, 9:48*am, "Graham Mayor" wrote: http://www.gmayor.com/installing_macro.htm -- Graham Mayor - *Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org Peter T. Daniels wrote: Wow -- I don't think anyone's bothered to fix the _case_ where it's involved in a transposition before! And Ctrl-T is the Hanging Indent shortcut -- which I always do with either the Ruler or the Paragraph Format tool, since anything automatic would have to be adjusted anyway,so it will have its own perfectly intuitive command! Thanks! Now to relocate the install-macro instructions ... On Oct 11, 2:02 am, "Graham Mayor" wrote:. As for transposing two selected characters, that macro would work, but I suspect the following refinement might suit the task better Sub Transpose() Dim sText As String sText = Selection.Range.Text If Len(sText) 2 Then MsgBox "You must select 2 characters!", _ vbCritical, "Transpose Characters" Exit Sub End If If Selection.Range.Characters(1).Case = 1 _ And Selection.Range.Characters(2).Case = 0 Then Selection.TypeText UCase(Mid(sText, 2, 1)) & _ LCase(Mid(sText, 1, 1)) Else Selection.TypeText Mid(sText, 2, 1) & _ Mid(sText, 1, 1) End If End Sub -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org - |
#12
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
"Transpose" macro Hebrew / right-to-left text
OK, but a little more error handling wouldn't hurt (and it would be possible
to either put the cursor between the characters or select them, but I haven't time to add that now. Maybe tomorrow). Sub Transpose() Dim oRng As Range Dim sText As String On Error GoTo ErrorHandler If ActiveDocument.Characters.Count 2 Then Set oRng = Selection.Range If Len(oRng) 0 Then MsgBox "You must place the cursor between the 2 characters to be transposed!", _ vbCritical, "Transpose Characters" Exit Sub End If With oRng .Start = .Start - 1 .End = .End + 1 .Select sText = .Text End With With Selection If .Range.Characters(1).Case = 1 _ And .Range.Characters(2).Case = 0 Then .TypeText UCase(Mid(sText, 2, 1)) & _ LCase(Mid(sText, 1, 1)) Else .TypeText Mid(sText, 2, 1) & _ Mid(sText, 1, 1) End If .MoveLeft wdCharacter End With Else MsgBox "Empty document", _ vbCritical, "Transpose Characters" End If End ErrorHandler: If Err.Number = 4248 Then MsgBox "No document open", _ vbCritical, "Transpose Characters" End If End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Peter T. Daniels wrote: I should Bookmark that in my browser ... One other thing (I hoped to add this before you saw the thread again!): can you make it work on two characters that the cursor is between, rather than having to select the two characters? On Oct 11, 9:48 am, "Graham Mayor" wrote: http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org Peter T. Daniels wrote: Wow -- I don't think anyone's bothered to fix the _case_ where it's involved in a transposition before! And Ctrl-T is the Hanging Indent shortcut -- which I always do with either the Ruler or the Paragraph Format tool, since anything automatic would have to be adjusted anyway,so it will have its own perfectly intuitive command! Thanks! Now to relocate the install-macro instructions ... On Oct 11, 2:02 am, "Graham Mayor" wrote:. As for transposing two selected characters, that macro would work, but I suspect the following refinement might suit the task better Sub Transpose() Dim sText As String sText = Selection.Range.Text If Len(sText) 2 Then MsgBox "You must select 2 characters!", _ vbCritical, "Transpose Characters" Exit Sub End If If Selection.Range.Characters(1).Case = 1 _ And Selection.Range.Characters(2).Case = 0 Then Selection.TypeText UCase(Mid(sText, 2, 1)) & _ LCase(Mid(sText, 1, 1)) Else Selection.TypeText Mid(sText, 2, 1) & _ Mid(sText, 1, 1) End If End Sub -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org - |
#13
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Hebrew / right-to-left text
Graham,
Seems that StrReverse would be an easier method. Sub Transpose() Dim myRange As Word.Range Dim bSpace As Boolean Dim pStr As String Dim i As Long Dim oWord As Word.Range Set myRange = Selection.Range bSpace = False If myRange.Words.Count 1 Then If MsgBox("If you want to transpose the entire selection select yes. Ohterwise only words will be transposed.", vbQuestion + vbYesNo, "Traspose Entire Phrase") = vbYes Then pStr = myRange.Text myRange.Text = StrReverse(pStr) Else For i = 1 To myRange.Words.Count If myRange.Words(i).Characters.Last = Chr(32) Then bSpace = True pStr = StrReverse(Trim(myRange.Words(i).Text)) If bSpace Then pStr = pStr & " " myRange.Words(i).Text = pStr bSpace = False Next End If Else pStr = myRange.Text myRange.Text = StrReverse(pStr) End If End Sub On Oct 11, 2:02*am, "Graham Mayor" wrote: The macro simply re-orders the selected text from end to start as if you had typed it backwards. I did not envisage using it for long texts, merely phrases inserted into an English document. However as I said I have no personal knowledge of left to right languages. As for transposing two selected characters, that macro would work, but I suspect the following refinement might suit the task better Sub Transpose() Dim sText As String sText = Selection.Range.Text If Len(sText) 2 Then * * MsgBox "You must select 2 characters!", _ * * vbCritical, "Transpose Characters" * * Exit Sub End If If Selection.Range.Characters(1).Case = 1 _ And Selection.Range.Characters(2).Case = 0 Then * * Selection.TypeText UCase(Mid(sText, 2, 1)) & _ * * LCase(Mid(sText, 1, 1)) Else * * Selection.TypeText Mid(sText, 2, 1) & _ * * Mid(sText, 1, 1) End If End Sub -- Graham Mayor - *Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org Peter T. Daniels wrote: As Tony noted, line breaks will be a problem -- but also, if there's more than one word, will it reverse each word independently, or do you need to type your whole clause backward, last-word-first? This would of course be most useful to make up for the most glaring omission in Word's editing tools since the very beginning (since lots of other DTP apps have it) -- "transpose two characters"! On Oct 10, 9:29 am, "Graham Mayor" wrote: Peter T. Daniels wrote: IF you're using a Hebrew font that just puts the letters in the a-z, A-Z etc. slots, then yes, you have to type backwards. If the font requires that the text is typed backwards (and I hasted to add I have no knowledge of right left languages) that can easily be fixed with a macro that will reverse the order of selected text eg Sub ReverseCharacters() Dim sText As String sText = Selection.Range.Text If Len(sText) 2 Then MsgBox "You must select at least 2 characters!", _ vbCritical, "Reverse Characters" Exit Sub End If For i = Len(sText) To 1 Step -1 Selection.TypeText Mid(sText, i, 1) Next i End Sub http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org - Hide quoted text - - Show quoted text - |
#14
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
"Transpose" macro Hebrew / right-to-left text
I think this is fraught with difficulty - almost by definition you are
dealing with complex scripts, and you really need to examine the selection for combining characters. I don't know Hebrew, but just as an example, consider the character בְ - this is a letter bet (ב) with a combining point sheva (ְ) below it - it is two characters (overlaid) in Word and swapping them round - indeed doing anything with them other than treating them as a single unit - is totally destructive. I hope this shows up properly in your newsreader - if not, the characters are U+5D1 (bet) and U+5B0 (sheva). -- Enjoy, Tony www.WordArticles.com "Graham Mayor" wrote in message ... OK, but a little more error handling wouldn't hurt (and it would be possible to either put the cursor between the characters or select them, but I haven't time to add that now. Maybe tomorrow). Sub Transpose() Dim oRng As Range Dim sText As String On Error GoTo ErrorHandler If ActiveDocument.Characters.Count 2 Then Set oRng = Selection.Range If Len(oRng) 0 Then MsgBox "You must place the cursor between the 2 characters to be transposed!", _ vbCritical, "Transpose Characters" Exit Sub End If With oRng .Start = .Start - 1 .End = .End + 1 .Select sText = .Text End With With Selection If .Range.Characters(1).Case = 1 _ And .Range.Characters(2).Case = 0 Then .TypeText UCase(Mid(sText, 2, 1)) & _ LCase(Mid(sText, 1, 1)) Else .TypeText Mid(sText, 2, 1) & _ Mid(sText, 1, 1) End If .MoveLeft wdCharacter End With Else MsgBox "Empty document", _ vbCritical, "Transpose Characters" End If End ErrorHandler: If Err.Number = 4248 Then MsgBox "No document open", _ vbCritical, "Transpose Characters" End If End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Peter T. Daniels wrote: I should Bookmark that in my browser ... One other thing (I hoped to add this before you saw the thread again!): can you make it work on two characters that the cursor is between, rather than having to select the two characters? On Oct 11, 9:48 am, "Graham Mayor" wrote: http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org Peter T. Daniels wrote: Wow -- I don't think anyone's bothered to fix the _case_ where it's involved in a transposition before! And Ctrl-T is the Hanging Indent shortcut -- which I always do with either the Ruler or the Paragraph Format tool, since anything automatic would have to be adjusted anyway,so it will have its own perfectly intuitive command! Thanks! Now to relocate the install-macro instructions ... On Oct 11, 2:02 am, "Graham Mayor" wrote:. As for transposing two selected characters, that macro would work, but I suspect the following refinement might suit the task better Sub Transpose() Dim sText As String sText = Selection.Range.Text If Len(sText) 2 Then MsgBox "You must select 2 characters!", _ vbCritical, "Transpose Characters" Exit Sub End If If Selection.Range.Characters(1).Case = 1 _ And Selection.Range.Characters(2).Case = 0 Then Selection.TypeText UCase(Mid(sText, 2, 1)) & _ LCase(Mid(sText, 1, 1)) Else Selection.TypeText Mid(sText, 2, 1) & _ Mid(sText, 1, 1) End If End Sub -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org - |
#15
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
"Transpose" macro Hebrew / right-to-left text
Oh, I wasn't talking about typos in Hebrew -- though in Modern Hebrew
the problem you raise will rarely come up, as the vowel points are rarely used (except in didactic texts and poetry). So, thanks again to Graham for a transposing tool! On Oct 11, 12:14Â*pm, "Tony Jollans" My forename at my surname dot com wrote: I think this is fraught with difficulty - almost by definition you are dealing with complex scripts, and you really need to examine the selection for combining characters. I don't know Hebrew, but just as an example, consider the character בְ - this is a letter bet (ב) with a combining point sheva (Ö°) below it - it is two characters (overlaid) in Word and swapping them round - indeed doing anything with them other than treating them as a single unit - is totally destructive. I hope this shows up properly in your newsreader - if not, the characters are U+5D1 (bet) and U+5B0 (sheva). -- Enjoy, Tony Â*www.WordArticles.com "Graham Mayor" wrote in message ... OK, but a little more error handling wouldn't hurt (and it would be possible to either put the cursor between the characters or select them, but I haven't time to add that now. Maybe tomorrow). Sub Transpose() Dim oRng As Range Dim sText As String On Error GoTo ErrorHandler If ActiveDocument.Characters.Count 2 Then Â* Â*Set oRng = Selection.Range Â* Â*If Len(oRng) 0 Then Â* Â* Â* Â*MsgBox "You must place the cursor between the 2 characters to be transposed!", _ Â* Â* Â* Â* Â* Â*vbCritical, "Transpose Characters" Â* Â* Â* Â*Exit Sub Â* Â*End If Â* Â*With oRng Â* Â* Â* Â*.Start = .Start - 1 Â* Â* Â* Â*.End = .End + 1 Â* Â* Â* Â*.Select Â* Â* Â* Â*sText = .Text Â* Â*End With Â* Â*With Selection Â* Â* Â* Â*If .Range.Characters(1).Case = 1 _ Â* Â* Â* Â* Â* Â*And .Range.Characters(2).Case = 0 Then Â* Â* Â* Â* Â* Â*.TypeText UCase(Mid(sText, 2, 1)) & _ Â* Â* Â* Â* Â* Â*LCase(Mid(sText, 1, 1)) Â* Â* Â* Â*Else Â* Â* Â* Â* Â* Â*.TypeText Mid(sText, 2, 1) & _ Â* Â* Â* Â* Â* Â*Mid(sText, 1, 1) Â* Â* Â* Â*End If Â* Â* Â* Â*.MoveLeft wdCharacter Â* Â*End With Else Â* Â*MsgBox "Empty document", _ Â* Â*vbCritical, "Transpose Characters" End If End ErrorHandler: If Err.Number = 4248 Then Â* Â*MsgBox "No document open", _ Â* Â*vbCritical, "Transpose Characters" End If End Sub -- Graham Mayor - Â*Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org Peter T. Daniels wrote: I should Bookmark that in my browser ... One other thing (I hoped to add this before you saw the thread again!): can you make it work on two characters that the cursor is between, rather than having to select the two characters? On Oct 11, 9:48 am, "Graham Mayor" wrote: http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org Peter T. Daniels wrote: Wow -- I don't think anyone's bothered to fix the _case_ where it's involved in a transposition before! And Ctrl-T is the Hanging Indent shortcut -- which I always do with either the Ruler or the Paragraph Format tool, since anything automatic would have to be adjusted anyway,so it will have its own perfectly intuitive command! Thanks! Now to relocate the install-macro instructions ... On Oct 11, 2:02 am, "Graham Mayor" wrote:. As for transposing two selected characters, that macro would work, but I suspect the following refinement might suit the task better Sub Transpose() Dim sText As String sText = Selection.Range.Text If Len(sText) 2 Then MsgBox "You must select 2 characters!", _ vbCritical, "Transpose Characters" Exit Sub End If If Selection.Range.Characters(1).Case = 1 _ And Selection.Range.Characters(2).Case = 0 Then Selection.TypeText UCase(Mid(sText, 2, 1)) & _ LCase(Mid(sText, 1, 1)) Else Selection.TypeText Mid(sText, 2, 1) & _ Mid(sText, 1, 1) End If End Sub -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org -- |
#16
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Hebrew / right-to-left text
Let's say 'alternative' rather than 'easier' However for the additional
issue of two transposed characters, it does not address the capitalisation where the transposed characters begin a sentence. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Greg Maxey wrote: Graham, Seems that StrReverse would be an easier method. Sub Transpose() Dim myRange As Word.Range Dim bSpace As Boolean Dim pStr As String Dim i As Long Dim oWord As Word.Range Set myRange = Selection.Range bSpace = False If myRange.Words.Count 1 Then If MsgBox("If you want to transpose the entire selection select yes. Ohterwise only words will be transposed.", vbQuestion + vbYesNo, "Traspose Entire Phrase") = vbYes Then pStr = myRange.Text myRange.Text = StrReverse(pStr) Else For i = 1 To myRange.Words.Count If myRange.Words(i).Characters.Last = Chr(32) Then bSpace = True pStr = StrReverse(Trim(myRange.Words(i).Text)) If bSpace Then pStr = pStr & " " myRange.Words(i).Text = pStr bSpace = False Next End If Else pStr = myRange.Text myRange.Text = StrReverse(pStr) End If End Sub On Oct 11, 2:02 am, "Graham Mayor" wrote: The macro simply re-orders the selected text from end to start as if you had typed it backwards. I did not envisage using it for long texts, merely phrases inserted into an English document. However as I said I have no personal knowledge of left to right languages. As for transposing two selected characters, that macro would work, but I suspect the following refinement might suit the task better Sub Transpose() Dim sText As String sText = Selection.Range.Text If Len(sText) 2 Then MsgBox "You must select 2 characters!", _ vbCritical, "Transpose Characters" Exit Sub End If If Selection.Range.Characters(1).Case = 1 _ And Selection.Range.Characters(2).Case = 0 Then Selection.TypeText UCase(Mid(sText, 2, 1)) & _ LCase(Mid(sText, 1, 1)) Else Selection.TypeText Mid(sText, 2, 1) & _ Mid(sText, 1, 1) End If End Sub -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org Peter T. Daniels wrote: As Tony noted, line breaks will be a problem -- but also, if there's more than one word, will it reverse each word independently, or do you need to type your whole clause backward, last-word-first? This would of course be most useful to make up for the most glaring omission in Word's editing tools since the very beginning (since lots of other DTP apps have it) -- "transpose two characters"! On Oct 10, 9:29 am, "Graham Mayor" wrote: Peter T. Daniels wrote: IF you're using a Hebrew font that just puts the letters in the a-z, A-Z etc. slots, then yes, you have to type backwards. If the font requires that the text is typed backwards (and I hasted to add I have no knowledge of right left languages) that can easily be fixed with a macro that will reverse the order of selected text eg Sub ReverseCharacters() Dim sText As String sText = Selection.Range.Text If Len(sText) 2 Then MsgBox "You must select at least 2 characters!", _ vbCritical, "Reverse Characters" Exit Sub End If For i = Len(sText) To 1 Step -1 Selection.TypeText Mid(sText, i, 1) Next i End Sub http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org - Hide quoted text - - Show quoted text - |
#17
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
"Transpose" macro Hebrew / right-to-left text
Following up with the revised version of the transposition macro I mentioned
yesterday: The following will transpose either two selected characters or the characters either side of the cursor and allows for those cases where the cursor is not located between two characters or more than two characters are selected. The cursor is left between the transposed characters so repeated use of the macro will toggle the transposition back and forth. I have added this version to my web page http://www.gmayor.com/word_vba_examples.htm#Transpose Sub Transpose() Dim oRng As Range Dim sText As String Dim Msg1 As String Dim Msg2 As String Dim Msg3 As String Dim MsgTitle As String Msg1 = "You must place the cursor between " & _ "the 2 characters to be transposed!" Msg2 = "There are no characters to transpose?" Msg3 = "There is no document open!" MsgTitle = "Transpose Characters" On Error GoTo ErrorHandler If ActiveDocument.Characters.Count 2 Then Set oRng = Selection.Range Select Case Len(oRng) Case Is = 0 If oRng.Start = oRng.Paragraphs(1).Range.Start Then MsgBox Msg1, vbCritical, MsgTitle Exit Sub End If If oRng.End = oRng.Paragraphs(1).Range.End - 1 Then MsgBox Msg1, vbCritical, MsgTitle Exit Sub End If With oRng .Start = .Start - 1 .End = .End + 1 .Select sText = .Text End With Case Is = 1 MsgBox Msg1, vbCritical, MsgTitle Exit Sub Case Is = 2 sText = Selection.Range.Text Case Else MsgBox Msg1, vbCritical, MsgTitle Exit Sub End Select With Selection If .Range.Characters(1).Case = 1 _ And .Range.Characters(2).Case = 0 Then .TypeText UCase(Mid(sText, 2, 1)) & _ LCase(Mid(sText, 1, 1)) Else .TypeText Mid(sText, 2, 1) & _ Mid(sText, 1, 1) End If .MoveLeft wdCharacter End With Else MsgBox Msg2, vbCritical, MsgTitle End If End ErrorHandler: If Err.Number = 4248 Then MsgBox Msg3, vbCritical, MsgTitle End If End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Peter T. Daniels wrote: Oh, I wasn't talking about typos in Hebrew -- though in Modern Hebrew the problem you raise will rarely come up, as the vowel points are rarely used (except in didactic texts and poetry). So, thanks again to Graham for a transposing tool! On Oct 11, 12:14 pm, "Tony Jollans" My forename at my surname dot com wrote: I think this is fraught with difficulty - almost by definition you are dealing with complex scripts, and you really need to examine the selection for combining characters. I don't know Hebrew, but just as an example, consider the character ?? - this is a letter bet (?) with a combining point sheva (?) below it - it is two characters (overlaid) in Word and swapping them round - indeed doing anything with them other than treating them as a single unit - is totally destructive. I hope this shows up properly in your newsreader - if not, the characters are U+5D1 (bet) and U+5B0 (sheva). -- Enjoy, Tony www.WordArticles.com "Graham Mayor" wrote in message ... OK, but a little more error handling wouldn't hurt (and it would be possible to either put the cursor between the characters or select them, but I haven't time to add that now. Maybe tomorrow). Sub Transpose() Dim oRng As Range Dim sText As String On Error GoTo ErrorHandler If ActiveDocument.Characters.Count 2 Then Set oRng = Selection.Range If Len(oRng) 0 Then MsgBox "You must place the cursor between the 2 characters to be transposed!", _ vbCritical, "Transpose Characters" Exit Sub End If With oRng .Start = .Start - 1 .End = .End + 1 .Select sText = .Text End With With Selection If .Range.Characters(1).Case = 1 _ And .Range.Characters(2).Case = 0 Then .TypeText UCase(Mid(sText, 2, 1)) & _ LCase(Mid(sText, 1, 1)) Else .TypeText Mid(sText, 2, 1) & _ Mid(sText, 1, 1) End If .MoveLeft wdCharacter End With Else MsgBox "Empty document", _ vbCritical, "Transpose Characters" End If End ErrorHandler: If Err.Number = 4248 Then MsgBox "No document open", _ vbCritical, "Transpose Characters" End If End Sub -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org Peter T. Daniels wrote: I should Bookmark that in my browser ... One other thing (I hoped to add this before you saw the thread again!): can you make it work on two characters that the cursor is between, rather than having to select the two characters? On Oct 11, 9:48 am, "Graham Mayor" wrote: http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org Peter T. Daniels wrote: Wow -- I don't think anyone's bothered to fix the _case_ where it's involved in a transposition before! And Ctrl-T is the Hanging Indent shortcut -- which I always do with either the Ruler or the Paragraph Format tool, since anything automatic would have to be adjusted anyway,so it will have its own perfectly intuitive command! Thanks! Now to relocate the install-macro instructions ... On Oct 11, 2:02 am, "Graham Mayor" wrote:. As for transposing two selected characters, that macro would work, but I suspect the following refinement might suit the task better Sub Transpose() Dim sText As String sText = Selection.Range.Text If Len(sText) 2 Then MsgBox "You must select 2 characters!", _ vbCritical, "Transpose Characters" Exit Sub End If If Selection.Range.Characters(1).Case = 1 _ And Selection.Range.Characters(2).Case = 0 Then Selection.TypeText UCase(Mid(sText, 2, 1)) & _ LCase(Mid(sText, 1, 1)) Else Selection.TypeText Mid(sText, 2, 1) & _ Mid(sText, 1, 1) End If End Sub -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org -- |
#18
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Hebrew / right-to-left text
Graham,.
Yes quite correct. I have seen that term so much recently in this group that it caught I must be missing the concept. If I type: Mr Smith goes to Washington place the cursor between the M and r of Mr then use your method I get: RmMr Smith goes to Washington If I select Mr and use my (slightly revised) method I get: Rm Smith goes to Washington Sub Transpose() Dim myRange As Word.Range Dim bSpace As Boolean Dim pStr As String Dim i As Long Dim oWord As Word.Range Set myRange = Selection.Range bSpace = False If myRange.Words.Count 1 Then If MsgBox("If you want to transpose the entire selection select yes. Otherwise only words will be transposed.", vbQuestion + vbYesNo, "Traspose Entire Phrase") = vbYes Then pStr = myRange.Text myRange.Text = StrReverse(pStr) myRange.Case = wdTitleSentence Else For i = 1 To myRange.Words.Count If myRange.Words(i).Characters.Last = Chr(32) Then bSpace = True pStr = StrReverse(Trim(myRange.Words(i).Text)) If bSpace Then pStr = pStr & " " myRange.Words(i).Text = pStr On Error Resume Next myRange.Words(i).Case = wdTitleSentence bSpace = False Next End If Else pStr = myRange.Text myRange.Text = StrReverse(pStr) myRange.Case = wdTitleSentence End If End Sub Graham Mayor wrote: Let's say 'alternative' rather than 'easier' However for the additional issue of two transposed characters, it does not address the capitalisation where the transposed characters begin a sentence. Greg Maxey wrote: Graham, Seems that StrReverse would be an easier method. Sub Transpose() Dim myRange As Word.Range Dim bSpace As Boolean Dim pStr As String Dim i As Long Dim oWord As Word.Range Set myRange = Selection.Range bSpace = False If myRange.Words.Count 1 Then If MsgBox("If you want to transpose the entire selection select yes. Ohterwise only words will be transposed.", vbQuestion + vbYesNo, "Traspose Entire Phrase") = vbYes Then pStr = myRange.Text myRange.Text = StrReverse(pStr) Else For i = 1 To myRange.Words.Count If myRange.Words(i).Characters.Last = Chr(32) Then bSpace = True pStr = StrReverse(Trim(myRange.Words(i).Text)) If bSpace Then pStr = pStr & " " myRange.Words(i).Text = pStr bSpace = False Next End If Else pStr = myRange.Text myRange.Text = StrReverse(pStr) End If End Sub On Oct 11, 2:02 am, "Graham Mayor" wrote: The macro simply re-orders the selected text from end to start as if you had typed it backwards. I did not envisage using it for long texts, merely phrases inserted into an English document. However as I said I have no personal knowledge of left to right languages. As for transposing two selected characters, that macro would work, but I suspect the following refinement might suit the task better Sub Transpose() Dim sText As String sText = Selection.Range.Text If Len(sText) 2 Then MsgBox "You must select 2 characters!", _ vbCritical, "Transpose Characters" Exit Sub End If If Selection.Range.Characters(1).Case = 1 _ And Selection.Range.Characters(2).Case = 0 Then Selection.TypeText UCase(Mid(sText, 2, 1)) & _ LCase(Mid(sText, 1, 1)) Else Selection.TypeText Mid(sText, 2, 1) & _ Mid(sText, 1, 1) End If End Sub -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org Peter T. Daniels wrote: As Tony noted, line breaks will be a problem -- but also, if there's more than one word, will it reverse each word independently, or do you need to type your whole clause backward, last-word-first? This would of course be most useful to make up for the most glaring omission in Word's editing tools since the very beginning (since lots of other DTP apps have it) -- "transpose two characters"! On Oct 10, 9:29 am, "Graham Mayor" wrote: Peter T. Daniels wrote: IF you're using a Hebrew font that just puts the letters in the a-z, A-Z etc. slots, then yes, you have to type backwards. If the font requires that the text is typed backwards (and I hasted to add I have no knowledge of right left languages) that can easily be fixed with a macro that will reverse the order of selected text eg Sub ReverseCharacters() Dim sText As String sText = Selection.Range.Text If Len(sText) 2 Then MsgBox "You must select at least 2 characters!", _ vbCritical, "Reverse Characters" Exit Sub End If For i = Len(sText) To 1 Step -1 Selection.TypeText Mid(sText, i, 1) Next i End Sub http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org - Hide quoted text - - Show quoted text - -- Greg Maxey See my web site http://gregmaxey.mvps.org for an eclectic collection of Word Tips. "It is not the critic who counts, not the man who points out how the strong man stumbles, or where the doer of deeds could have done them better. The credit belongs to the man in the arena, whose face is marred by dust and sweat and blood, who strives valiantly...who knows the great enthusiasms, the great devotions, who spends himself in a worthy cause, who at the best knows in the end the triumph of high achievement, and who at the worst, if he fails, at least fails while daring greatly, so that his place shall never be with those cold and timid souls who have never known neither victory nor defeat." - TR |
#19
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Hebrew / right-to-left text
If you use my last posted version and put the cursor between the M and r of
Mr, or select Mr, Mr Smith is transposed to Rm Smith, which is what was intended. Neither of the simpler versions I posted yesterday, behave in the manner you describe. The version posted this morning combines the two so that a user may put the cursor between or select the characters to be transposed. The earlier macro in the thread, the theme of which you have developed, was concerned more with re-typing a string backwards to attempt to correct a right to left text that was not correctly formatted from right to left, but as others have posted, this is not the best way to approach that topic. The question about the transposition of 2 characters merely evolved from that. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Greg Maxey wrote: Graham,. Yes quite correct. I have seen that term so much recently in this group that it caught I must be missing the concept. If I type: Mr Smith goes to Washington place the cursor between the M and r of Mr then use your method I get: RmMr Smith goes to Washington If I select Mr and use my (slightly revised) method I get: Rm Smith goes to Washington Sub Transpose() Dim myRange As Word.Range Dim bSpace As Boolean Dim pStr As String Dim i As Long Dim oWord As Word.Range Set myRange = Selection.Range bSpace = False If myRange.Words.Count 1 Then If MsgBox("If you want to transpose the entire selection select yes. Otherwise only words will be transposed.", vbQuestion + vbYesNo, "Traspose Entire Phrase") = vbYes Then pStr = myRange.Text myRange.Text = StrReverse(pStr) myRange.Case = wdTitleSentence Else For i = 1 To myRange.Words.Count If myRange.Words(i).Characters.Last = Chr(32) Then bSpace = True pStr = StrReverse(Trim(myRange.Words(i).Text)) If bSpace Then pStr = pStr & " " myRange.Words(i).Text = pStr On Error Resume Next myRange.Words(i).Case = wdTitleSentence bSpace = False Next End If Else pStr = myRange.Text myRange.Text = StrReverse(pStr) myRange.Case = wdTitleSentence End If End Sub Graham Mayor wrote: Let's say 'alternative' rather than 'easier' However for the additional issue of two transposed characters, it does not address the capitalisation where the transposed characters begin a sentence. Greg Maxey wrote: Graham, Seems that StrReverse would be an easier method. Sub Transpose() Dim myRange As Word.Range Dim bSpace As Boolean Dim pStr As String Dim i As Long Dim oWord As Word.Range Set myRange = Selection.Range bSpace = False If myRange.Words.Count 1 Then If MsgBox("If you want to transpose the entire selection select yes. Ohterwise only words will be transposed.", vbQuestion + vbYesNo, "Traspose Entire Phrase") = vbYes Then pStr = myRange.Text myRange.Text = StrReverse(pStr) Else For i = 1 To myRange.Words.Count If myRange.Words(i).Characters.Last = Chr(32) Then bSpace = True pStr = StrReverse(Trim(myRange.Words(i).Text)) If bSpace Then pStr = pStr & " " myRange.Words(i).Text = pStr bSpace = False Next End If Else pStr = myRange.Text myRange.Text = StrReverse(pStr) End If End Sub On Oct 11, 2:02 am, "Graham Mayor" wrote: The macro simply re-orders the selected text from end to start as if you had typed it backwards. I did not envisage using it for long texts, merely phrases inserted into an English document. However as I said I have no personal knowledge of left to right languages. As for transposing two selected characters, that macro would work, but I suspect the following refinement might suit the task better Sub Transpose() Dim sText As String sText = Selection.Range.Text If Len(sText) 2 Then MsgBox "You must select 2 characters!", _ vbCritical, "Transpose Characters" Exit Sub End If If Selection.Range.Characters(1).Case = 1 _ And Selection.Range.Characters(2).Case = 0 Then Selection.TypeText UCase(Mid(sText, 2, 1)) & _ LCase(Mid(sText, 1, 1)) Else Selection.TypeText Mid(sText, 2, 1) & _ Mid(sText, 1, 1) End If End Sub -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org Peter T. Daniels wrote: As Tony noted, line breaks will be a problem -- but also, if there's more than one word, will it reverse each word independently, or do you need to type your whole clause backward, last-word-first? This would of course be most useful to make up for the most glaring omission in Word's editing tools since the very beginning (since lots of other DTP apps have it) -- "transpose two characters"! On Oct 10, 9:29 am, "Graham Mayor" wrote: Peter T. Daniels wrote: IF you're using a Hebrew font that just puts the letters in the a-z, A-Z etc. slots, then yes, you have to type backwards. If the font requires that the text is typed backwards (and I hasted to add I have no knowledge of right left languages) that can easily be fixed with a macro that will reverse the order of selected text eg Sub ReverseCharacters() Dim sText As String sText = Selection.Range.Text If Len(sText) 2 Then MsgBox "You must select at least 2 characters!", _ vbCritical, "Reverse Characters" Exit Sub End If For i = Len(sText) To 1 Step -1 Selection.TypeText Mid(sText, i, 1) Next i End Sub http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org - Hide quoted text - - Show quoted text - |
#20
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
"Transpose" macro Hebrew / right-to-left text
I don't understand what you mean by "where the cursor is not located
between the two characters" -- does that simply mean that it works by selecting two characters? And the following phrase means it will reverse the sequence of any number of selected characters? (Both those qualifications don't appear in the website description.) I'll replace yesterday's macro with this one, so thank you again! Also, I noticed a tiny glitch in your "installing macros" instructions yesterday. I don't need to put Transpose on the QAT, but I do want a keyboard shortcut. The instructions give the impression that you need a button on the QAT to assign a shortcut to a macro, but t turns out you don't -- just skip the step to add it to the QAT and go on to click the Shortcut button. (However, the name of the macro does _not_ appear in the shortcut-assigning panel, as I'm accustomed to seeing when I assign a shortcut to a character.) On Oct 12, 1:54*am, "Graham Mayor" wrote: Following up with the revised version of the transposition macro I mentioned yesterday: The following will transpose either two selected characters or the characters either side of the cursor and allows for those cases where the cursor is not located between two characters or more than two characters are selected. The cursor is left between the transposed characters so repeated use of the macro will toggle the transposition back and forth. I have added this version to my web pagehttp://www.gmayor.com/word_vba_examples.htm#Transpose Sub Transpose() Dim oRng As Range Dim sText As String Dim Msg1 As String Dim Msg2 As String Dim Msg3 As String Dim MsgTitle As String Msg1 = "You must place the cursor between " & _ * * * *"the 2 characters to be transposed!" Msg2 = "There are no characters to transpose?" Msg3 = "There is no document open!" MsgTitle = "Transpose Characters" On Error GoTo ErrorHandler If ActiveDocument.Characters.Count 2 Then * * Set oRng = Selection.Range * * Select Case Len(oRng) * * Case Is = 0 * * * * If oRng.Start = oRng.Paragraphs(1).Range.Start Then * * * * * * MsgBox Msg1, vbCritical, MsgTitle * * * * * * Exit Sub * * * * End If * * * * If oRng.End = oRng.Paragraphs(1).Range.End - 1 Then * * * * * * MsgBox Msg1, vbCritical, MsgTitle * * * * * * Exit Sub * * * * End If * * * * With oRng * * * * * * .Start = .Start - 1 * * * * * * .End = .End + 1 * * * * * * .Select * * * * * * sText = .Text * * * * End With * * Case Is = 1 * * * * MsgBox Msg1, vbCritical, MsgTitle * * * * Exit Sub * * Case Is = 2 * * * * sText = Selection.Range.Text * * Case Else * * * * MsgBox Msg1, vbCritical, MsgTitle * * * * Exit Sub * * End Select * * With Selection * * * * If .Range.Characters(1).Case = 1 _ * * * * * * And .Range.Characters(2).Case = 0 Then * * * * * * .TypeText UCase(Mid(sText, 2, 1)) & _ * * * * * * LCase(Mid(sText, 1, 1)) * * * * Else * * * * * * .TypeText Mid(sText, 2, 1) & _ * * * * * * Mid(sText, 1, 1) * * * * End If * * * * .MoveLeft wdCharacter * * End With Else * * MsgBox Msg2, vbCritical, MsgTitle End If End ErrorHandler: If Err.Number = 4248 Then * * MsgBox Msg3, vbCritical, MsgTitle End If End Sub -- Graham Mayor - *Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org Peter T. Daniels wrote: Oh, I wasn't talking about typos in Hebrew -- though in Modern Hebrew the problem you raise will rarely come up, as the vowel points are rarely used (except in didactic texts and poetry). So, thanks again to Graham for a transposing tool! On Oct 11, 12:14 pm, "Tony Jollans" My forename at my surname dot com wrote: I think this is fraught with difficulty - almost by definition you are dealing with complex scripts, and you really need to examine the selection for combining characters. I don't know Hebrew, but just as an example, consider the character ?? - this is a letter bet (?) with a combining point sheva (?) below it - it is two characters (overlaid) in Word and swapping them round - indeed doing anything with them other than treating them as a single unit - is totally destructive. I hope this shows up properly in your newsreader - if not, the characters are U+5D1 (bet) and U+5B0 (sheva). -- Enjoy, Tony www.WordArticles.com "Graham Mayor" wrote in message ... OK, but a little more error handling wouldn't hurt (and it would be possible to either put the cursor between the characters or select them, but I haven't time to add that now. Maybe tomorrow). Sub Transpose() Dim oRng As Range Dim sText As String On Error GoTo ErrorHandler If ActiveDocument.Characters.Count 2 Then Set oRng = Selection.Range If Len(oRng) 0 Then MsgBox "You must place the cursor between the 2 characters to be transposed!", _ vbCritical, "Transpose Characters" Exit Sub End If With oRng .Start = .Start - 1 .End = .End + 1 .Select sText = .Text End With With Selection If .Range.Characters(1).Case = 1 _ And .Range.Characters(2).Case = 0 Then .TypeText UCase(Mid(sText, 2, 1)) & _ LCase(Mid(sText, 1, 1)) Else .TypeText Mid(sText, 2, 1) & _ Mid(sText, 1, 1) End If .MoveLeft wdCharacter End With Else MsgBox "Empty document", _ vbCritical, "Transpose Characters" End If End ErrorHandler: If Err.Number = 4248 Then MsgBox "No document open", _ vbCritical, "Transpose Characters" End If End Sub -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org Peter T. Daniels wrote: I should Bookmark that in my browser ... One other thing (I hoped to add this before you saw the thread again!): can you make it work on two characters that the cursor is between, rather than having to select the two characters? On Oct 11, 9:48 am, "Graham Mayor" wrote: http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org Peter T. Daniels wrote: Wow -- I don't think anyone's bothered to fix the _case_ where it's involved in a transposition before! And Ctrl-T is the Hanging Indent shortcut -- which I always do with either the Ruler or the Paragraph Format tool, since anything automatic would have to be adjusted anyway,so it will have its own perfectly intuitive command! Thanks! Now to relocate the install-macro instructions ... On Oct 11, 2:02 am, "Graham Mayor" wrote:. As for transposing two selected characters, that macro would work, but I suspect the following refinement might suit the task better Sub Transpose() Dim sText As String sText = Selection.Range.Text If Len(sText) 2 Then MsgBox "You must select 2 characters!", _ vbCritical, "Transpose Characters" Exit Sub End If If Selection.Range.Characters(1).Case = 1 _ And Selection.Range.Characters(2).Case = 0 Then Selection.TypeText UCase(Mid(sText, 2, 1)) & _ LCase(Mid(sText, 1, 1)) Else Selection.TypeText Mid(sText, 2, 1) & _ Mid(sText, 1, 1) End If End Sub -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org --- |
#21
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
"Transpose" macro Hebrew / right-to-left text
Ok, I tried it, and it does transpose either two selected letters or
the letters the cursor is between (so it works perfectly), but selecting three letters produced only the message "You must place the cursor between the 2 characters to be transposed!" On Oct 12, 8:48*am, "Peter T. Daniels" wrote: I don't understand what you mean by "where the cursor is not located between the two characters" -- does that simply mean that it works by selecting two characters? And the following phrase means it will reverse the sequence of any number of selected characters? (Both those qualifications don't appear in the website description.) I'll replace yesterday's macro with this one, so thank you again! Also, I noticed a tiny glitch in your "installing macros" instructions yesterday. I don't need to put Transpose on the QAT, but I do want a keyboard shortcut. The instructions give the impression that you need a button on the QAT to assign a shortcut to a macro, but t turns out you don't -- just skip the step to add it to the QAT and go on to click the Shortcut button. (However, the name of the macro does _not_ appear in the shortcut-assigning panel, as I'm accustomed to seeing when I assign a shortcut to a character.) On Oct 12, 1:54*am, "Graham Mayor" wrote: Following up with the revised version of the transposition macro I mentioned yesterday: The following will transpose either two selected characters or the characters either side of the cursor and allows for those cases where the cursor is not located between two characters or more than two characters are selected. The cursor is left between the transposed characters so repeated use of the macro will toggle the transposition back and forth. I have added this version to my web |
#22
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
"Transpose" macro Hebrew / right-to-left text
What I mean by not between 2 characters is where the cursor before the first
character of the current paragraph or after the last, or if there is no document open or an empty document. If you select one or more than two characters you do indeed get that warning message as the macro will only handle two character transpositions. You can change the wording if you prefer, but as you wanted the cursor to work from between the characters the message simply reminds of that requirement. The error trapping messages are primarily concerned with accidental applications of the macro in inappropriate locations. I'll have a look at the web page instructions re the QAT vis-a-vis the shortcut key. However the macroname should appear in the right window of the shortcut key editor, when macros are selected in the left. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Peter T. Daniels wrote: Ok, I tried it, and it does transpose either two selected letters or the letters the cursor is between (so it works perfectly), but selecting three letters produced only the message "You must place the cursor between the 2 characters to be transposed!" On Oct 12, 8:48 am, "Peter T. Daniels" wrote: I don't understand what you mean by "where the cursor is not located between the two characters" -- does that simply mean that it works by selecting two characters? And the following phrase means it will reverse the sequence of any number of selected characters? (Both those qualifications don't appear in the website description.) I'll replace yesterday's macro with this one, so thank you again! Also, I noticed a tiny glitch in your "installing macros" instructions yesterday. I don't need to put Transpose on the QAT, but I do want a keyboard shortcut. The instructions give the impression that you need a button on the QAT to assign a shortcut to a macro, but t turns out you don't -- just skip the step to add it to the QAT and go on to click the Shortcut button. (However, the name of the macro does _not_ appear in the shortcut-assigning panel, as I'm accustomed to seeing when I assign a shortcut to a character.) On Oct 12, 1:54 am, "Graham Mayor" wrote: Following up with the revised version of the transposition macro I mentioned yesterday: The following will transpose either two selected characters or the characters either side of the cursor and allows for those cases where the cursor is not located between two characters or more than two characters are selected. The cursor is left between the transposed characters so repeated use of the macro will toggle the transposition back and forth. I have added this version to my web |
#23
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
"Transpose" macro Hebrew / right-to-left text
Ah -- you were simply saying that you made a little change to let the
user know that selecting _more_ than two characters wouldn't work. On Oct 12, 9:11*am, "Graham Mayor" wrote: What I mean by not between 2 characters is where the cursor before the first character of the current paragraph or after the last, or if there is no document open or an empty document. If you select one or more than two characters you do indeed get that warning message as the macro will only handle two character transpositions. You can change the wording if you prefer, but as you wanted the cursor to work from between the characters the message simply reminds of that requirement. The error trapping messages are primarily concerned with accidental applications of the macro in inappropriate locations. I'll have a look at the web page instructions re the QAT vis-a-vis the shortcut key. However the macroname should appear in the right window of the shortcut key editor, when macros are selected in the left. -- Graham Mayor - *Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org Peter T. Daniels wrote: Ok, I tried it, and it does transpose either two selected letters or the letters the cursor is between (so it works perfectly), but selecting three letters produced only the message "You must place the cursor between the 2 characters to be transposed!" On Oct 12, 8:48 am, "Peter T. Daniels" wrote: I don't understand what you mean by "where the cursor is not located between the two characters" -- does that simply mean that it works by selecting two characters? And the following phrase means it will reverse the sequence of any number of selected characters? (Both those qualifications don't appear in the website description.) I'll replace yesterday's macro with this one, so thank you again! Also, I noticed a tiny glitch in your "installing macros" instructions yesterday. I don't need to put Transpose on the QAT, but I do want a keyboard shortcut. The instructions give the impression that you need a button on the QAT to assign a shortcut to a macro, but t turns out you don't -- just skip the step to add it to the QAT and go on to click the Shortcut button. (However, the name of the macro does _not_ appear in the shortcut-assigning panel, as I'm accustomed to seeing when I assign a shortcut to a character.) On Oct 12, 1:54 am, "Graham Mayor" wrote: Following up with the revised version of the transposition macro I mentioned yesterday: The following will transpose either two selected characters or the characters either side of the cursor and allows for those cases where the cursor is not located between two characters or more than two characters are selected. The cursor is left between the transposed characters so repeated use of the macro will toggle the transposition back and forth. I have added this version to my web- |
#24
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
"Transpose" macro Hebrew / right-to-left text
Exactly! If a user selects more than 2 characters, the macro cannot
determine which, if any, of those characters are the two to be transposed so would produce an error condition. The message alerts the user to that error. Greg has pointed out that my macro required the Word option 'Typing Replaces Selected Text' setting (this is the default condition). To overcome this he has suggested a minor change which I have added to my web page version this morning. If you have the option set you won't notice any difference with the modified version. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Peter T. Daniels wrote: Ah -- you were simply saying that you made a little change to let the user know that selecting _more_ than two characters wouldn't work. On Oct 12, 9:11 am, "Graham Mayor" wrote: What I mean by not between 2 characters is where the cursor before the first character of the current paragraph or after the last, or if there is no document open or an empty document. If you select one or more than two characters you do indeed get that warning message as the macro will only handle two character transpositions. You can change the wording if you prefer, but as you wanted the cursor to work from between the characters the message simply reminds of that requirement. The error trapping messages are primarily concerned with accidental applications of the macro in inappropriate locations. I'll have a look at the web page instructions re the QAT vis-a-vis the shortcut key. However the macroname should appear in the right window of the shortcut key editor, when macros are selected in the left. -- Graham Mayor - Word MVP My web sitewww.gmayor.com Word MVP web sitehttp://word.mvps.org Peter T. Daniels wrote: Ok, I tried it, and it does transpose either two selected letters or the letters the cursor is between (so it works perfectly), but selecting three letters produced only the message "You must place the cursor between the 2 characters to be transposed!" On Oct 12, 8:48 am, "Peter T. Daniels" wrote: I don't understand what you mean by "where the cursor is not located between the two characters" -- does that simply mean that it works by selecting two characters? And the following phrase means it will reverse the sequence of any number of selected characters? (Both those qualifications don't appear in the website description.) I'll replace yesterday's macro with this one, so thank you again! Also, I noticed a tiny glitch in your "installing macros" instructions yesterday. I don't need to put Transpose on the QAT, but I do want a keyboard shortcut. The instructions give the impression that you need a button on the QAT to assign a shortcut to a macro, but t turns out you don't -- just skip the step to add it to the QAT and go on to click the Shortcut button. (However, the name of the macro does _not_ appear in the shortcut-assigning panel, as I'm accustomed to seeing when I assign a shortcut to a character.) On Oct 12, 1:54 am, "Graham Mayor" wrote: Following up with the revised version of the transposition macro I mentioned yesterday: The following will transpose either two selected characters or the characters either side of the cursor and allows for those cases where the cursor is not located between two characters or more than two characters are selected. The cursor is left between the transposed characters so repeated use of the macro will toggle the transposition back and forth. I have added this version to my web- |
#25
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
"Transpose" macro Hebrew / right-to-left text
I remembered to check this when I was seeing what the Zoom commands
are called in 2007 (they're called Zoom). When I select a command that's already on the QAT and click to add a keyboard shortcut, I get the panel familiar to me from creating keyboard shortcuts from Insert Symbol. When I type some command in the box for it, at the bottom of the panel it gives the name of the command it will become the keyboard shortcut for (in Insert Symbol, it shows the symbol that will be inserted). But when I added a keyboard shortcut for the macro that I didn't put on the QAT, the name of the macro didn't appear at the bottom of the Create Shortcut panel. (But the shortcut was created properly anyway.) It's simply a display difference, but one that raises a hint of insecurity -- it's possible that you could have mistakenly selected the wrong macro from the list but this would have alerted you to such a mistake. On Oct 12, 9:11 am, "Graham Mayor" wrote: I'll have a look at the web page instructions re the QAT vis-a-vis the shortcut key. However the macroname should appear in the right window of the shortcut key editor, when macros are selected in the left. Also, I noticed a tiny glitch in your "installing macros" instructions yesterday. I don't need to put Transpose on the QAT, but I do want a keyboard shortcut. The instructions give the impression that you need a button on the QAT to assign a shortcut to a macro, but t turns out you don't -- just skip the step to add it to the QAT and go on to click the Shortcut button. (However, the name of the macro does _not_ appear in the shortcut-assigning panel, as I'm accustomed to seeing when I assign a shortcut to a character.) |
#26
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Hebrew / right-to-left text
Left Alt + Shift toggles between Hebrew and English and automatically types
text in the right direction. Punctuation looks like it will go in the wrong place but is actually placed correctly. "Terri N" wrote: I selected the Hebrew phrase, then chose right-to-left (RTL), hoping that only the phrase itself would read RTL, per my customer's request. But the entire paragraph switched to RTL. So Word can't switch just the phrase? And you're saying that if you're typing a left-to-right English paragraph, the Hebrew phrase in the middle of it is going to have to read left to right as well? I'm having a hard time locating a Unicode Hebrew font--does a font that supports all the Hebrew characters (including vowels) come with Windows? I may be missing it. There is a font called "David" on my list. The person who will be typing the text is using a Mac, and I'll then have to paste it into my Word document and convert it to whatever font I'll be using. I found one online called Ezra that the customer likes, but it doesn't mention Unicode in the name. Thank you for the hint the punctuation. I've tried it with a little success in a couple of spots, and I'll keep trying and see if I can get the hang of it. Thanks for your help, Peter...this job is a huge challenge for me. But, as with most problems, I'm also learning a lot. -- Terri "Peter T. Daniels" wrote: 1. What do you mean by "block out"? If the Hebrew text has been typed with a proper Unicode Hebrew font, it should behave exactly as it needs to -- this week I've been typing Arabic words in the middle of German text, and all is well. The paragraph remains left-to-right, because that's the direction of your main text. (If you wanted an English word in the middle of a Hebrew paragraph, you wouldn't switch the paragraph to left-to-rignt.) 2. I did warn you that funny things happen at the interface. The most practical way to deal with stray punctuation is to select the wrong items and then press Backspace or Delete (or Ctrl-X), not to try just deleting them. The most practical way to insert punctuation at an interface is to type some spaces, put the colon or whatever in the middle of them, and select, then delete, the spaces that are in the wrong place. (If you type the punctuation while you're typing the text, there's no problem, but since you're inserting rather than typing, you'll encounter finicky behavior.) I don't know why adjacent characters are deleting, but if you select the space or colon and then delete, it probably won't happen. On Oct 9, 7:08 pm, Terri N wrote: I am so close...the Hebrew text I am inserting into my English document has a couple of glitches left. I'm wondering if there is a utility I can use.. I've already installed a Hebrew keyboard, which fixed almost everything. The last two problems: 1. When I insert a bit of Hebrew into the middle of a paragraph, I then block out that Hebrew text and hit the "right-to-left" icon. But instead of applying it to the Hebrew, it applies it to the entire paragraph. 2. The punctuation is drifting. For instance, if there is a colon, instead of it being attached to the previous letter, it attaches to the next letter, after the space. So it looks sort of like this :with the colon. I can't just reverse the space and colon, because if I delete the space, the "s" deletes also. If I delete the colon, the "w" deletes also. Any guidance? -- Terri |
#27
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Hebrew / right-to-left text
Thanks to Peter and everyone who contributed to this thread...you guys are
amazing! I dream of knowing 20% of what you know about this program... I was a WordPerfect girl from the beginning, and the change to Word has been difficult, but this discussion group is just a godsend. -- Terri "Peter T. Daniels" wrote: On Oct 10, 2:13 am, Terri N wrote: I selected the Hebrew phrase, then chose right-to-left (RTL), hoping that only the phrase itself would read RTL, per my customer's request. But the entire paragraph switched to RTL. So Word can't switch just the phrase? And you're saying that if you're typing a left-to-right English paragraph, the Hebrew phrase in the middle of it is going to have to read left to right as well? Of course not. Are you in fact not using a Unicode Hebrew font? If you're using a Hebrew font that just puts the letters in the a-z, A-Z etc. slots, then yes, you have to type backwards. But then you might as weill just type transliterations of the Hebrew! I'm having a hard time locating a Unicode Hebrew font--does a font that supports all the Hebrew characters (including vowels) come with Windows? I may be missing it. There is a font called "David" on my list. Fonts with the full complement of Hebrew characters include Arial, Tahoma, and Times New Roman. Fonts intended for Modern Hebrew, such as David, don't have the accents (cantillation marks) used only in Bible texts. But David _is_ a Unicode font (it came with either Windows or Office, since the only Hebrew I ever downloaded was SBL Hebrew, which is made especially for typing all the complicated stuff in the Bible text). The person who will be typing the text is using a Mac, and I'll then have to paste it into my Word document and convert it to whatever font I'll be using. I found one online called Ezra that the customer likes, but it doesn't mention Unicode in the name. If it comes in different versions for Mac and Windows, then it probably isn't a Unicode font. Possibly if you hunt around you can find a version of Ezra that's been Unicode-encoded. Ah -- Ezra is from the SIL, so it's free; it is Unicode; and it has the full set of characters. It looks like the type found in early-20th- century Conservative prayer books. (And a lot of the Haggadahs you'll find next March.) Thank you for the hint the punctuation. I've tried it with a little success in a couple of spots, and I'll keep trying and see if I can get the hang of it. Thanks for your help, Peter...this job is a huge challenge for me. But, as with most problems, I'm also learning a lot. -- Terri "Peter T. Daniels" wrote: 1. What do you mean by "block out"? If the Hebrew text has been typed with a proper Unicode Hebrew font, it should behave exactly as it needs to -- this week I've been typing Arabic words in the middle of German text, and all is well. The paragraph remains left-to-right, because that's the direction of your main text. (If you wanted an English word in the middle of a Hebrew paragraph, you wouldn't switch the paragraph to left-to-rignt.) 2. I did warn you that funny things happen at the interface. The most practical way to deal with stray punctuation is to select the wrong items and then press Backspace or Delete (or Ctrl-X), not to try just deleting them. The most practical way to insert punctuation at an interface is to type some spaces, put the colon or whatever in the middle of them, and select, then delete, the spaces that are in the wrong place. (If you type the punctuation while you're typing the text, there's no problem, but since you're inserting rather than typing, you'll encounter finicky behavior.) I don't know why adjacent characters are deleting, but if you select the space or colon and then delete, it probably won't happen. On Oct 9, 7:08 pm, Terri N wrote: I am so close...the Hebrew text I am inserting into my English document has a couple of glitches left. I'm wondering if there is a utility I can use.. I've already installed a Hebrew keyboard, which fixed almost everything. The last two problems: 1. When I insert a bit of Hebrew into the middle of a paragraph, I then block out that Hebrew text and hit the "right-to-left" icon. But instead of applying it to the Hebrew, it applies it to the entire paragraph. 2. The punctuation is drifting. For instance, if there is a colon, instead of it being attached to the previous letter, it attaches to the next letter, after the space. So it looks sort of like this :with the colon.. I can't just reverse the space and colon, because if I delete the space, the "s" deletes also. If I delete the colon, the "w" deletes also. Any guidance? -- Terri- |
#28
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Hebrew / right-to-left text
Dear All,
This is not quite the topic of discussion in this thread but this was the closest I could find. I've had the same problem in both Word 2003 and 2007 and can't find any information about it. The problem does not always occur but is frequent enough to be very annoying and I can't seem to figure out why it happens or doesn't happen: If I have an existing document of Hebrew text, whether typed or cut- and-paste from another program, often when I try to insert text by typing, nothing will appear or be inserted. That is, if I attempt to type Hebrew characters. If I type non-Hebrew characters (e.g. numbers, punctuation) in the Hebrew font, or switch to an English font, the typing inserts as would be expected. If I add a space, then backspace, I can usually begin typing inserted text. This is not due to Overwrite/ Insert being toggled or anything else I can determine. Any ideas? Thank you! -- Ari |
#29
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Hebrew / right-to-left text
Hmm. I've never used a computer whose native language is Hebrew. Are
you sure that all the texts you're using involve proper Unicode Hebrew, and not old fonts that were slotted into the a-z A-Z slots of the olden days? I assume you have both Hebrew and English IME's activated in Windows? I can certainly confirm that weird and annoying things happen precisely at the interfaces between l-r and r-l script passages, and the control codes don't show up with "Show Non-Printing Characters." On Oct 29, 4:10*pm, Ari wrote: Dear All, This is not quite the topic of discussion in this thread but this was the closest I could find. I've had the same problem in both Word 2003 and 2007 and can't find any information about it. The problem does not always occur but is frequent enough to be very annoying and I can't seem to figure out why it happens or doesn't happen: If I have an existing document of Hebrew text, whether typed or cut- and-paste from another program, often when I try to insert text by typing, nothing will appear or be inserted. That is, if I attempt to type Hebrew characters. If I type non-Hebrew characters (e.g. numbers, punctuation) in the Hebrew font, or switch to an English font, the typing inserts as would be expected. If I add a space, then backspace, I can usually begin typing inserted text. This is not due to Overwrite/ Insert being toggled or anything else I can determine. Any ideas? Thank you! -- Ari |
#30
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Hebrew / right-to-left text
On Oct 29, 7:12*pm, "Peter T. Daniels" wrote:
Hmm. I've never used a computer whose native language is Hebrew. Are you sure that all the texts you're using involve proper Unicode Hebrew, and not old fonts that were slotted into the a-z A-Z slots of the olden days? I assume you have both Hebrew and English IME's activated in Windows? I can certainly confirm that weird and annoying things happen precisely at the interfaces between l-r and r-l script passages, and the control codes don't show up with "Show Non-Printing Characters." On Oct 29, 4:10*pm, Ari wrote: Dear All, This is not quite the topic of discussion in this thread but this was the closest I could find. I've had the same problem in both Word 2003 and 2007 and can't find any information about it. The problem does not always occur but is frequent enough to be very annoying and I can't seem to figure out why it happens or doesn't happen: If I have an existing document of Hebrew text, whether typed or cut- and-paste from another program, often when I try to insert text by typing, nothing will appear or be inserted. That is, if I attempt to type Hebrew characters. If I type non-Hebrew characters (e.g. numbers, punctuation) in the Hebrew font, or switch to an English font, the typing inserts as would be expected. If I add a space, then backspace, I can usually begin typing inserted text. This is not due to Overwrite/ Insert being toggled or anything else I can determine. Any ideas? Thank you! -- Ari The native language of my computer is English. This occurs with documents that I've typed entirely myself in Word when going back to edit them. I had the experience a couple of days ago, but when I had shut down and returned to the file later it didn't occur, so I wonder if it's somehow related to some active process that cleared with a restart. It's still incredibly odd to occur only with Hebrew text characters and not numbers, symbols, punctuation, or spaces, but for now I'll try a restart the next time it happens and see if it helps. Just wondering if anyone else out there had experienced this. Thanks! Ari |
#31
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Hebrew / right-to-left text
On Nov 6, 9:38*am, Ari wrote:
On Oct 29, 7:12*pm, "Peter T. Daniels" wrote: Hmm. I've never used a computer whose native language is Hebrew. Are you sure that all the texts you're using involve proper Unicode Hebrew, and not old fonts that were slotted into the a-z A-Z slots of the olden days? I assume you have both Hebrew and English IME's activated in Windows? I can certainly confirm that weird and annoying things happen precisely at the interfaces between l-r and r-l script passages, and the control codes don't show up with "Show Non-Printing Characters." On Oct 29, 4:10*pm, Ari wrote: Dear All, This is not quite the topic of discussion in this thread but this was the closest I could find. I've had the same problem in both Word 2003 and 2007 and can't find any information about it. The problem does not always occur but is frequent enough to be very annoying and I can't seem to figure out why it happens or doesn't happen: If I have an existing document of Hebrew text, whether typed or cut- and-paste from another program, often when I try to insert text by typing, nothing will appear or be inserted. That is, if I attempt to type Hebrew characters. If I type non-Hebrew characters (e.g. numbers, punctuation) in the Hebrew font, or switch to an English font, the typing inserts as would be expected. If I add a space, then backspace, I can usually begin typing inserted text. This is not due to Overwrite/ Insert being toggled or anything else I can determine. Any ideas? Thank you! -- Ari The native language of my computer is English. This occurs with documents that I've typed entirely myself in Word when going back to edit them. I had the experience a couple of days ago, but when I had shut down and returned to the file later it didn't occur, so I wonder if it's somehow related to some active process that cleared with a restart. It's still incredibly odd to occur only with Hebrew text characters and not numbers, symbols, punctuation, or spaces, but for now I'll try a restart the next time it happens and see if it helps. Just wondering if anyone else out there had experienced this. Thanks! You still didn't say whether you're using a Hebrew IME (keyboard etc.) and a Unicode font, or whether you have an old font that doesn't use Unicode encoding, and whether there are that sort of difference in the pasted text as well as in the typed text. |
#32
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Hebrew / right-to-left text
Peter-
Sorry for not clarifying. I am using the Hebrew IME and it seems to occur with all the fonts I use, which are all proper Unicode Hebrew (including the Arial and Times New Roman Hebrew fonts).There doesn't seem to be any such difference in the pasted text either. Thanks! Ari Peter T. Daniels wrote: On Nov 6, 9:38*am, Ari wrote: On Oct 29, 7:12*pm, "Peter T. Daniels" wrote: Hmm. I've never used a computer whose native language is Hebrew. Are you sure that all the texts you're using involve proper Unicode Hebrew, and not old fonts that were slotted into the a-z A-Z slots of the olden days? I assume you have both Hebrew and English IME's activated in Windows? I can certainly confirm that weird and annoying things happen precisely at the interfaces between l-r and r-l script passages, and the control codes don't show up with "Show Non-Printing Characters." On Oct 29, 4:10*pm, Ari wrote: Dear All, This is not quite the topic of discussion in this thread but this was the closest I could find. I've had the same problem in both Word 2003 and 2007 and can't find any information about it. The problem does not always occur but is frequent enough to be very annoying and I can't seem to figure out why it happens or doesn't happen: If I have an existing document of Hebrew text, whether typed or cut- and-paste from another program, often when I try to insert text by typing, nothing will appear or be inserted. That is, if I attempt to type Hebrew characters. If I type non-Hebrew characters (e.g. numbers, punctuation) in the Hebrew font, or switch to an English font, the typing inserts as would be expected. If I add a space, then backspace, I can usually begin typing inserted text. This is not due to Overwrite/ Insert being toggled or anything else I can determine. Any ideas? Thank you! -- Ari The native language of my computer is English. This occurs with documents that I've typed entirely myself in Word when going back to edit them. I had the experience a couple of days ago, but when I had shut down and returned to the file later it didn't occur, so I wonder if it's somehow related to some active process that cleared with a restart. It's still incredibly odd to occur only with Hebrew text characters and not numbers, symbols, punctuation, or spaces, but for now I'll try a restart the next time it happens and see if it helps. Just wondering if anyone else out there had experienced this. Thanks! You still didn't say whether you're using a Hebrew IME (keyboard etc.) and a Unicode font, or whether you have an old font that doesn't use Unicode encoding, and whether there are that sort of difference in the pasted text as well as in the typed text. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Right-to-left (Hebrew) tables in English Word? | Tables | |||
Right-to-left (Hebrew) tables in English Word? | Page Layout | |||
Typing Hebrew in Word 2000 from Right to Left | Microsoft Word Help | |||
Typing Hebrew from right to left in Word 2000 | Microsoft Word Help | |||
Word 2000: need to expand the header to the left; left text margi. | Page Layout |