Because of the need for batch translation, it is necessary to replace special style of professional vocabulary, so I went to the recording macros, get the following code
The bold
The
reference Mercury Accumulation Replace with The reference Mercury Accumulation Elemental mercury accumulation Selection. The HomeKey Unit:=wdStory Selection. The Find. ClearFormatting Selection. The Find. The Font, Bold=True Selection. The Find. Replacement. ClearFormatting With the Selection. The Find The Text="Mercury Accumulation" . Replacement. Text="Mercury Accumulation ^ p elemental Mercury Accumulation" The Forward=True The Wrap=wdFindContinue . The Format=True The MatchCase=False . MatchWholeWord=False . MatchByte=True . MatchWildcards=False . MatchSoundsLike=False . MatchAllWordForms=False End With With Selection If. The Find. Forward=True Then . The Collapse Direction:=wdCollapseStart The Else . The Collapse Direction:=wdCollapseEnd End the If . The Find. Execute the Replace:=wdReplaceOne If. The Find. Forward=True Then . The Collapse Direction:=wdCollapseEnd The Else . The Collapse Direction:=wdCollapseStart End the If . The Find. The Execute End With Selection. The Find. The Execute Problem is a thesaurus is too big, if all are written as a macro, cannot be performed, because the Office macros at compile time, a process of the code shall not exceed 64000 characters, So the next step is to need me to put the word inventory in a Excel list, and then call? The small white is very confused CodePudding user response:
Write "thesaurus" death to the code, it must be very bad, With the database or Excel table, is the right thing to do, So, write the "code", the code can not move; And word library add or delete, modification, maintenance directly corresponding database or document that (the "maintenance" you give it to someone else to do) can CodePudding user response:
reference 1/f, a toast to invite the bright moon response: write "thesaurus" death to the code, it must be very bad, With the database or Excel table, is the right thing to do, So, write the "code", the code can not move; And word library add or delete, modification, maintenance directly corresponding database or document that (the "maintenance" you give it to someone else to do) can So I should use which kinds of vb command or algorithm that can provide a direction to study on my own under CodePudding user response:
Look at your "language", the feeling you are no programming basis? Programming is not "commands" but "statement", Any "functions" (or "algorithm"), are made by a series of basic statement, The reasonable and correct "of" combination of logic and process control, can be realized, Complex things, not for a will can say clear, Your question, I think the key point is "the lexicon" in the document and identification, How to accurately "find" the professional vocabulary, you need is a very important question, If processes is not good, "out of context" problems, Most appear to look the consequences of, (think about previous "translation" in full effect... Translated instead more look not to understand! As to how to realize the textual substitution, that is the simple things...