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. 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.
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 re: 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 <Ter...@discussions.microsoft.com> 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..
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.)
> > > Terri-
> 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
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Also, I'm not sure just reversing text with a macro will deal with line
breaks properly.
--
Enjoy,
Tony
"Graham Mayor" <gma...@REMOVETHISmvps.org> wrote in message
news:esQMv2aS...@TK2MSFTNGP04.phx.gbl...
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"!
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
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
On Oct 11, 2:02 am, "Graham Mayor" <gma...@REMOVETHISmvps.org> 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
>
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
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" <gma...@REMOVETHISmvps.org> wrote:
> http://www.gmayor.com/installing_macro.htm
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> >> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>-
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
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
> >> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>- Hide quoted text -
>
> - Show quoted text -
I hope this shows up properly in your newsreader - if not, the characters
are U+5D1 (bet) and U+5B0 (sheva).
--
Enjoy,
Tony
"Graham Mayor" <gma...@REMOVETHISmvps.org> wrote in message
news:uHfHpFoS...@TK2MSFTNGP05.phx.gbl...
So, thanks again to Graham for a transposing tool!
On Oct 11, 12:14 pm, "Tony Jollans" <My forename at my surname dot
> >>>>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>--
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
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
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
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
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
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
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" <gma...@REMOVETHISmvps.org> 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
> >>>>>>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>---
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
On Oct 12, 9:11 am, "Graham Mayor" <gma...@REMOVETHISmvps.org> 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
> >>> version to my web-
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
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" <gma...@REMOVETHISmvps.org> 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"
"Peter T. Daniels" wrote:
> > > > after the space. So it looks sort of like this :with the colon.. I can't
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
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."
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
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.