斑竹,请帮忙看一下。 写了一个检查工具,但是有一点问题。 是在日文字符的语言属性被设定为“中文(中国)”的时候,明明是日文但是还是会被当成中文,不知道有什么好办法。参见sample.doc文件 代码如下: Function markChinese() With Selection.Find .LanguageID = wdSimplifiedChinese .Text = "(?)" .Replacement.Text = "\1" .Replacement.Font.Color = wdColorRed .Forward = True .Wrap = wdFindContinue .Format = True .MatchWildcards = True End With markChinese = Selection.Find.Execute(Replace:=wdReplaceAll) End Function Sub chkChinese() Dim rgnStory As Range Dim found As Boolean found = False For Each rgnStory In ActiveDocument.StoryRanges rgnStory.Select If (markChinese = True) Then found = True Do While Not (rgnStory.NextStoryRange Is Nothing) Set rgnStory = rgnStory.NextStoryRange Loop Next rgnStory If found Then MsgBox "Found Chinese fonts!", vbCritical, "Warning" Else MsgBox "No Chinese fonts found!", vbInformation, "Congratulations!" End If ActiveWindow.View.Type = wdPrintView End Sub
Ko6nkIsp.rar
(3.64 KB, 下载次数: 13)
[此贴子已经被作者于2006-9-23 12:54:02编辑过] |