Home > Software engineering >  How to use VBA search for specific words in the word (for help!!!!! )
How to use VBA search for specific words in the word (for help!!!!! )

Time:10-13

In word, I tried many ways to look for at a point before a word or words,

For example:

Difference your freedom IT, flexi. bility, and control the while reducing your IT overhead . Stop managing the servers and the get guaranteed 99. 9% uptime . Move to the cloud on your terms . Connect your on-premises servers to Office 365 and run the latest d.d. version of Office side by side with a previous version while the users transition. Stay in control and save time by managing your services easily in the admin center from any browser and by automating management tasks using PowerShell commands.

In this example I want to find:

Flexi., 99., uptime., terms, d.d., commands, etc.

Principle is the search for the "point" in front of a word until there is "a" space,

VBA write?

Thank you master

CodePudding user response:

Start recording macros in the Word 2003, manual, complete the required function end record macros, press Alt + F11 key, check just record macro corresponding VBA code,
 Selection. The Find. ClearFormatting 
With the Selection. The Find
The Text="& lt; [0-9 a Za - z] @. "
. Replacement. Text=""
The Forward=True
The Wrap=wdFindContinue
. The Format=False
The MatchCase=False
. MatchWholeWord=False
. MatchByte=False
. MatchAllWordForms=False
. MatchSoundsLike=False
. MatchWildcards=True
End With
Selection. The Find. The Execute
Selection. The Find. The Execute
Selection. The Find. The Execute
Selection. The Find. The Execute
Selection. The Find. The Execute
Selection. The Find. The Execute
Selection. The Find. The Execute
Selection. The Find. The Execute
Selection. The Find. The Execute
Selection. The Find. The Execute

CodePudding user response:

Thank you upstairs,

But this is simply looking for the beginning of 0 to 9 or any expression of the letter to the
Such as d.d. can only find d.

Is there a way from right to left to find space?

CodePudding user response:

Remind: the string to find the problem domain, the regular expression is not everything. There's mastercard & And the finite state automata is universal,
"Compiler principle" reference of lexical analysis and the finite state automata,
  •  Tags:  
  • VBA
  • Related