View Single Post
  #1   Report Post  
rstahltx rstahltx is offline
Junior Member
 
Posts: 0
Default Phonetic Guide Macro

I am trying to create a Macro that takes the selected text and adds the Phonetic Guide Pinyin text on top Chinese characters. If I just record a 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 the "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, if you just want to paste the exact code to make it work, I will gladly accept--I am not proud. This macro would save me a lot of time, since I cannot change the default setting of Word's Phonetic Guide.

Thanks!