R
rstahltx
I am trying to create a Macro that takes the selected text and adds th
Phonetic Guide Pinyin text on top Chinese characters. If I just record
macro to do this task, I get this:
Sub test1()
With Selection
.Start = 4573
.End = 4574
.Range.PhoneticGuide Text:="shi", Alignment:= _
wdPhoneticGuideAlignmentCenter, Raise:=12, FontSize:=5
FontName:="fontname"
End With
End Sub
It works, but I need a range using my current selected text, and th
"Text:=" should not already be predefined in the macro--that, of course
makes it useless. I tried the following with no luck:
Sub AddPhoneticGuide()
Dim myRange As Range
Set myRange = ActiveDocument.Range(Selection.Range.Start
Selection.Range.End)
With myRange
.Range.PhoneticGuide Alignment:=wdPhoneticGuideAlignmentCenter
Raise:=27, FontSize:=13, FontName:="fontname"
End With
End Sub
I have no experience writing macros, which is probably obvious; so, i
you just want to paste the exact code to make it work, I will gladl
accept--I am not proud. This macro would save me a lot of time, since
cannot change the default setting of Word's Phonetic Guide.
Thanks
Phonetic Guide Pinyin text on top Chinese characters. If I just record
macro to do this task, I get this:
Sub test1()
With Selection
.Start = 4573
.End = 4574
.Range.PhoneticGuide Text:="shi", Alignment:= _
wdPhoneticGuideAlignmentCenter, Raise:=12, FontSize:=5
FontName:="fontname"
End With
End Sub
It works, but I need a range using my current selected text, and th
"Text:=" should not already be predefined in the macro--that, of course
makes it useless. I tried the following with no luck:
Sub AddPhoneticGuide()
Dim myRange As Range
Set myRange = ActiveDocument.Range(Selection.Range.Start
Selection.Range.End)
With myRange
.Range.PhoneticGuide Alignment:=wdPhoneticGuideAlignmentCenter
Raise:=27, FontSize:=13, FontName:="fontname"
End With
End Sub
I have no experience writing macros, which is probably obvious; so, i
you just want to paste the exact code to make it work, I will gladl
accept--I am not proud. This macro would save me a lot of time, since
cannot change the default setting of Word's Phonetic Guide.
Thanks