Replace all non latin characters with their latin a-z counterparts and word count in VBA
I am trying to write a script in VBA that will:
replace all É and other similar characters with their latin counterparts.
Remove all non alpha numeric
characters.Remove duplicate spacing
then word count the string
I have worked out that i can split the string on开发者_StackOverflow社区 " " and count the elements to get the word count... but I am struggling on the rest of it. Help much appreciated.
Word has a word count built in for sentences, paragraphs and the entire document:
ActiveDocument.Words.Count
As for replace, it is probably easiest to record a macro to see how this works. You will have to replace the accented characters one by one, or use RegEx to replace all A type (Å, Ä, Â ,Á, À) characters with A, and so on.
精彩评论