M
MLGrant
Greetings all,
I am trying to build a macro that can efficiently search through a document
and highlight (or underline) any characters that are double-byte/fullwidth
Japanese. Currently, I am resorting to checking each character of the
document, one by one, and inserting an '@' character before each character
(or string of adjacent characters if there's more than one).
I have no experience building macros, and have only been able to come up
with the following (excerpt):
Can anyone recommend a better, more efficient way of going about this?
I have also tried using the built-in Find function and tried searching for
everything EXCEPT A-Z, etc. (i.e. using the regex:
[!A-Za-z0-9^0013-^0255^t^m^x^z^n\@ ]* ). However I haven't found a regex
that works 100%.
Any ideas/suggestions?
Thanks.
I am trying to build a macro that can efficiently search through a document
and highlight (or underline) any characters that are double-byte/fullwidth
Japanese. Currently, I am resorting to checking each character of the
document, one by one, and inserting an '@' character before each character
(or string of adjacent characters if there's more than one).
I have no experience building macros, and have only been able to come up
with the following (excerpt):
Code:
WordCount = ActiveDocument.Content.Words.Count
i = 1
While i < WordCount + 1
Application.StatusBar = i & "/" & WordCount & " ワードを処ç†ã—ã¦ã„ã¾ã™..."
LenOrgWord = LenB(ActiveDocument.Content.Words(i))
LenCvtdWord = LenB(StrConv(ActiveDocument.Content.Words(i),
vbFromUnicode))
If LenOrgWord = LenCvtdWord Then
With ActiveDocument.Words(i)
.InsertBefore ("ï¼ ")
.Font.Color = wdColorRed
End With
i = i + 1
WordCount = WordCount + 1
End If
i = i + 1
Wend
Can anyone recommend a better, more efficient way of going about this?
I have also tried using the built-in Find function and tried searching for
everything EXCEPT A-Z, etc. (i.e. using the regex:
[!A-Za-z0-9^0013-^0255^t^m^x^z^n\@ ]* ). However I haven't found a regex
that works 100%.
Any ideas/suggestions?
Thanks.