PDA

View Full Version : Replace texts with non-latin charaters using "Find all word forms"



vkhu
01-13-2018, 09:19 AM
Hi all, I'm having a problem with a search & replace macro.

I use "Find all word forms" option to search for all conjugations of the word "sleep" (slept, sleeps, sleeping, sleep) and replace them with "ngủ" (the translation for them in Vietnamese).

The problem is the character "ủ" isn't recognized as part of the latin alphabet, and all forms of "sleep" was replaced with "ng?".

I'm currently forced to replace "sleep" with "ajsdhra", and have a separate search function to replace all "ajsdhra" with "ngủ". This doubles the time needed for the macro to work, and it takes over an hour to finish (it's supposed to replace many other words aside from "sleep").

Is there anyway to force "Find all word forms" accept non-latin characters as replacement?

P/S: I cross-posted this on Stackoverflow: https://stackoverflow.com/questions/48241817/replace-texts-with-non-latin-charaters-using-find-all-word-forms-in-ms-word-20

macropod
01-13-2018, 01:46 PM
You are correct that the 'MatchAllWordForms = True' doesn't work with replacements like ngủ. However, you should be able to use ngủ, followed by a replacement of ng? with ngủ (with 'MatchAllWordForms = False').
It seems
unlikely that one change would double the processing time for your whole macro. That said, there may be other ways to optimize your code but, without seeing it, we can't really give specific advice.

PS: Kindly update your Stackoverflow post to alert them to the cross-post here.