Hi
I need to create a macro that will remove all capitalized words from a selected text. For example I need to make a macro that would change:
"He went with Sue to Barringer's grocery store to buy Jensen pickles"
to...
"went with to grocery store to buy pickles"
Does anyone know how to use macro scheduler to do this?
Please let me know
Thanks
Nate
Remove all captial words from a paragraph
Moderators: Dorian (MJT support), JRL
Pickles!
One way to approach this task is to start by creating some rough logic on what the code would do.
Starting from position 1.
Let>k=1
Loop through (start at 1, see Repeat/Until, or Goto/Label).....
- Check if the character at position1 is uppercase.
(There are probably a few ways to so this. One is using vbscript;
Let>YourLetter={Copy(Phrase,k,1)}
VBEval>Asc("%YourLetter%"),asciiresult
(I thought there was a simple command for this but now can't find it)
Then see if "asciiresult" is between the number for A and Z. (A=65, B=66, etc)
- If it is A-Z, then you either need the next "space" from your position to the end, of if there are no more spaces, you're probably and the end word. Remove appropriate section of text, repeat loop if you're not at the end.
..or
- If not A-Z, add 1, then repeat loop if you're not at the end.
Before you do "continue the loop", make sure k will still be equal or longer than the phrase.
The entire thing could be done with a nice VBScript routine, but that involves getting deeper into vbscript. :]
One way to approach this task is to start by creating some rough logic on what the code would do.
Starting from position 1.
Let>k=1
Loop through (start at 1, see Repeat/Until, or Goto/Label).....
- Check if the character at position1 is uppercase.
(There are probably a few ways to so this. One is using vbscript;
Let>YourLetter={Copy(Phrase,k,1)}
VBEval>Asc("%YourLetter%"),asciiresult
(I thought there was a simple command for this but now can't find it)
Then see if "asciiresult" is between the number for A and Z. (A=65, B=66, etc)
- If it is A-Z, then you either need the next "space" from your position to the end, of if there are no more spaces, you're probably and the end word. Remove appropriate section of text, repeat loop if you're not at the end.
..or
- If not A-Z, add 1, then repeat loop if you're not at the end.
Before you do "continue the loop", make sure k will still be equal or longer than the phrase.
The entire thing could be done with a nice VBScript routine, but that involves getting deeper into vbscript. :]
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Maybe read each line, and use Separate, breaking at the space character.
Then look at the first character of each element.
If ASCII value is lower case, keep and concatenate onto existing elements. If ASCII value is upper case range, skip it, then go to next element.
Then look at the first character of each element.
If ASCII value is lower case, keep and concatenate onto existing elements. If ASCII value is upper case range, skip it, then go to next element.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!