虫虫技术在线--技术决定出路

当前位置: 首页 > 办公 > Excel >

Excel汉字转拼音的方法(4)

时间:2010-07-20 22:50来源:虫虫技术在线收集整理 作者:虫虫编辑 点击:
Else GetPinYin = IFELanguage_GetMorphResult(HzStr) End If End If End Function Public Function AdjustPhoneticNotation(Hz As String, pn As PhoneticNotation) As String Dim i As Integer AdjustPhoneticNota

         Else
             GetPinYin = IFELanguage_GetMorphResult(HzStr)
         End If
     End If
End Function
Public Function AdjustPhoneticNotation(Hz As String, pn As PhoneticNotation) As String
     Dim i As Integer
    
     AdjustPhoneticNotation = Hz
     '未进行优化
     Select Case pn
         Case pnNoNotation
         For i = LBound(dNotation) To UBound(dNotation)
             AdjustPhoneticNotation = Replace(AdjustPhoneticNotation, sNotation1(i), dNotation(i))
         Next
         For i = LBound(dNotation) To UBound(dNotation)
             AdjustPhoneticNotation = Replace(AdjustPhoneticNotation, sNotation2(i), dNotation(i))
         Next
     End Select
End Function
Private Sub Class_Initialize()
     IFELanguage = 0
     InitalArray
     InitialOnly = False
     GenGUID
     If CoCreateInstance(MSIME_GUID, 0, 1, _
                         IFELanguage_GUID, IFELanguage) = 0 Then
         IFELanguage_Open
         pvUseSeperator = False
         pvSeperator = " "
     Else
         Err.Raise "OLE error!!"
     End If
End Sub
Private Sub Class_Terminate()
     If IFELanguage <> 0 Then IFELanguage_Close
End Sub
Property Get Seperator() As String
     Seperator = pvSeperator
End Property
Property Let Seperator(Value As String)
     pvSeperator = Value
End Property
Property Get UseSeperator() As Boolean
     UseSeperator = pvUseSeperator
End Property
Property Let UseSeperator(Value As Boolean)
     pvUseSeperator = Value
End Property
Property Get InitialOnly() As Boolean
     UseSeperator = pvInitialOnly
End Property
Property Let InitialOnly(Value As Boolean)
     pvInitialOnly = Value
End Property
Property Get OnlyOneChar() As Boolean
     UseSeperator = pvOnlyOneChar
End Property
Property Let OnlyOneChar(Value As Boolean)
     pvOnlyOneChar = Value
End Property

第三步:返回EXCEL,开始调用。

(责任编辑:admin)
顶一下
(0)
0%
踩一下
(1)
100%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:点击我更换图片
栏目列表
推荐内容