|
Sub i1_TC2SC() 'Created on 7/6/2018 From Traditional to Simplified Chinese
Dim sPos As Long
Dim myRange As Range
Dim myContent As Range
Dim Lng As Single
Dim t As Date
Dim Message As String
Dim intResponse As Integer
Dim WSshell As Object
Dim Title As String
Title = "Convert Traditional Chinese to Simplified Chinese"
Application.ScreenUpdating = False
t = Now
Set myContent = ActiveDocument.Content
Set WSshell = CreateObject("WScript.Shell")
Lng = Len(myContent)
sPos = Selection.Start
If sPos = 0 Then Set myRange = myContent
If Selection.Type = wdSelectionNormal Then
Set myRange = Selection.Range
Else
sPos = Selection.Start
Selection.MoveRight Unit:=wdCharacter, Count:=Lng - sPos, Extend:=wdExtend
End If
'WordBasic.ToolsTCSCTranslate Direction:=0, Varients:=0, TranslateCommon:=0
'Selection.Range.TCSCConverter wdTCSCConverterDirectionTCSC, True, True '1, True, True
Selection.Range.TCSCConverter WdTCSCConverterDirection:=wdTCSCConverterDirectionTCSC, CommonTerms:=False, UseVariants:=True 'char by char
With Selection
.Font.Size = 10
.Font.NameFarEast = "KaiXinSong"
.Font.NameAscii = "Arial"
End With
Application.ScreenUpdating = True
Message = ChrW$(&H8FD0) & ChrW$(&H884C) & ChrW$(&H65F6) & ChrW$(&H95F4) & ChrW$(&HFF1A)
intResponse = WSshell.popup(Message & DateDiff("s", t, Now) & ChrW$(&H20) & ChrW$(&H79D2), 1200, Title, 64)
Selection.Start = sPos
Selection.Collapse wdCollapseStart
End Sub
Sub i2_SC2TC() 'Created on 7/6/2018 From Simplified to Traditional Chinese
Dim sPos As Long
Dim myRange As Range
Dim myContent As Range
Dim Lng As Single
Dim t As Date
Dim Message As String
Dim intResponse As Integer
Dim WSshell As Object
Dim Title As String
Title = "Convert Simplified Chinese to Traditional Chinese"
t = Now
Application.ScreenUpdating = False
Set myContent = ActiveDocument.Content
Set WSshell = CreateObject("WScript.Shell")
Lng = Len(myContent)
sPos = Selection.Start
If sPos = 0 Then Set myRange = myContent
If Selection.Type = wdSelectionNormal Then
Set myRange = Selection.Range
Else
sPos = Selection.Start
Selection.MoveRight Unit:=wdCharacter, Count:=Lng - sPos, Extend:=wdExtend
End If
'WordBasic.ToolsSCTCTranslate Direction:=0, Varients:=0, TranslateCommon:=0 Convert from Simplified Chinese to Traditional Chinese
Selection.Range.TCSCConverter wdTCSCConverterDirectionSCTC, CommonTerms:=False, UseVariants:=True 'From Simplified Chinese to Traditon char by char
Application.ScreenUpdating = True
With Selection
.Font.Size = 10
.Font.NameFarEast = "KaiXinSong"
.Font.NameAscii = "Arial"
End With
Message = ChrW$(&H8FD0) & ChrW$(&H884C) & ChrW$(&H65F6) & ChrW$(&H95F4) & ChrW$(&HFF1A)
intResponse = WSshell.popup(Message & DateDiff("s", t, Now) & ChrW$(&H20) & ChrW$(&H79D2), 1200, Title, 64)
Selection.Start = sPos
Selection.Collapse wdCollapseStart
End Sub
|
|