Beginner needs help writing Word Macro for productivity gain in language studies using Phonetic Guide Ruby Text in Word 2019
I'm studying Chinese, have the Chinese language pack and keyboard installed. What I want to do is to cut down the number of mouse clicks required to turnon/off the display of Ruby which is done via using the Phoentic guide.
By hand this means selcting my Chinese character text, Home Menu/ Font grouping/ Phonetic Guide/ Offset=5, Size=10/ OK
I cannot then select another piece of text and reapply.
Therein lies my problem, as for language lists,reading passages etc I want to turn the Ruby one for those characters or groups of characters I don't know, then turn them off as my confidence at reading them without the Pinyin grows.
In addition it is not possibe to select a whole passage and them apply Phonet ic guide, it seemingly only does some unknown number of characters at a time. Totally frustrating and I have reported this elsewhere to no avail, so onward to try to find a workaround
My thoughts are that as a work around is to write a Macro button which would do this for me for any selction of text I select
If anyone can think of a better solutions I'd be glad to hear it. It will save my hours over the next months/years of learning.
Now I've never written a macro before and so begun by using the Record button, this got me a Macro which is as follows
Sub AddRuby2()
'
' AddRuby2 Macro
'
'
With Selection
.Start = 877
.End = 879
.Range.PhoneticGuide Text:="wù", Alignment:= _
wdPhoneticGuideAlignmentOneTwoOne, Raise:=15, FontSize:=8, FontName _
:="Microsoft YaHei"
End With
With Selection
.Start = 877
.End = 877
.Range.PhoneticGuide Text:="ji" & ChrW(257), Alignment:= _
wdPhoneticGuideAlignmentOneTwoOne, Raise:=15, FontSize:=8, FontName _
:="Microsoft YaHei"
End With
End Sub
BUT that doesn't do what I want and I don't know how to get it to do it.
I can see how to write adjustments to the Raise and Font Size, that's clear enough
how do I get it to work on the text I select?
ie not
With Selection .Start = 877 .End = 879
AND
how do I get it to work with whatever characters I select to run the Marco on ie not the "wu" and "ji" which were in the selction I chose when recording?