守柔大哥: 我想你是误会我了,我是向来都很佩服你的,今天我删除我的解决方案是由于我发现了其中几个错误之处,还有一点是运行效率不高,放到VB中跟本不行,怕被批得一无是处,原本是再修改了放上来的,故删除了. 再一次向
我的笨办法是: Sub gUnicode() Dim MyRange As Range Selection.HomeKey Unit:=wdStory With Selection.Find .ClearFormatting .MatchWildcards = True .Text = "&#x[!<]@\;" Do While .Execute(findtext:=.Text) k = k + 1 Loop End With For i = 1 To k Set MyRange = ActiveDocument.Content With MyRange.Find .ClearFormatting .Forward = True .MatchWildcards = True .Text = "&#x[!<]@\;" Do While .Execute If MyRange.Text = "�" Then MyRange.Text = "时" If MyRange.Text = "−" Then MyRange.Text = "-" If MyRange.Text = "⋅" Then MyRange.Text = "·" If MyRange.Text = "˜" Then MyRange.Text = "~" If MyRange.Text = "⇒" Then MyRange.Text = "" MyRange.Text = Unicode2AscII(Mid(MyRange, 4, 4)) Loop End With Next End Sub Public Function Unicode2AscII(ByVal s As String) On Error Resume Next Dim i As Integer Dim r As String For i = 1 To Len(s) Step 4 r = r + ChrB("&H" & Mid(s, i + 2, 2)) & ChrB("&H" & Mid(s, i, 2)) Next Unicode2AscII = r End Function 还是请各位大哥指点为盼!
[此贴子已经被守柔于2006-2-28 7:04:17编辑过] |