Identify sentences by WORD Macro

T

Thejan Mendis

Hi All,

I just need a big help to create kind of a macro, I have around 2000
documents to apply thses rules. Hope somebody can help me.

1/ In these documents there are lot of occasion that some people have forgot
to put a space after the coma. I need to create a macro that will correct
the problem. (hopefuly I may able to create this ;-))

2/ And the biggest problem is... there lot of occasion that, there is no
space after the Period (.) of sentence..
e.g.: hello guys.This is me...

I should be space after the sentence like...
hello guys. This is me...


It was hard for me to create something on this because some times (.) is
used for other purposes. so is there way I can I identify the end of the
sentence and forced to put a space end of the line(sentence) but not in the
everyway like

* In fraction numbers 466484.464
* Initials T.N.T.
* Only logic I found was mostly there is a capital letter (a word stating
from capital letter) after the sentence.


PLEASE ANYBODY CAN HELP ME



TJ
 
M

Malcolm Smith

People forget to put a space after a full stop or a comma?

I think that you need to train people the rudiments of whatever language
your users are typing in more than giving them this crutch to encourage
their bad typing habits.

But, that doesn't solve the problems of older documents, does it? Now,
questions. What is your native language?

Does your language have the comma as the thousands separator and the full
stop (period) as the decimal point separator?

Regards
-Malc
www.dragondrop.com
 
W

Word Heretic

G'day "Thejan Mendis" <[email protected]>,

I have a commercial tool that does this. Contact me offlist if you
need to know more.

www.wordheretic.com


Thejan Mendis said:
Hi All,

I just need a big help to create kind of a macro, I have around 2000
documents to apply thses rules. Hope somebody can help me.

1/ In these documents there are lot of occasion that some people have forgot
to put a space after the coma. I need to create a macro that will correct
the problem. (hopefuly I may able to create this ;-))

2/ And the biggest problem is... there lot of occasion that, there is no
space after the Period (.) of sentence..
e.g.: hello guys.This is me...

I should be space after the sentence like...
hello guys. This is me...


It was hard for me to create something on this because some times (.) is
used for other purposes. so is there way I can I identify the end of the
sentence and forced to put a space end of the line(sentence) but not in the
everyway like

* In fraction numbers 466484.464
* Initials T.N.T.
* Only logic I found was mostly there is a capital letter (a word stating
from capital letter) after the sentence.


PLEASE ANYBODY CAN HELP ME



TJ

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
Email (e-mail address removed)
Products http://www.geocities.com/word_heretic/products.html

Replies offlist may require payment.
 
K

Klaus Linke

You could try a wildcard replacement (check "Match wildcards"):
Find what: ([,.])([!0-9^32^13.])
Replace with: \1^32\2

In place of ^32, you can also simply type a space. I just used ^32 because a
space is easy to overlook.
^13 is the code of a paragraph mark, and I chose not to put in spaces if the
comma/dot appears in a number (... as Malcolm said, it could be a decimal
delimiter as in $1,345.32. And also, the replacement doesn't put spaces in
an "ellipsis" (= "...").

\1 is the comma or full stop (= the stuff in the first bracket), \2 the
following character.

You can read the replacement as "Look for a comma or full stop that isn't
followed by a number, or a space, or a ¶, or a full stop, and if you find
such a pair: put a space in between".

Hope I haven't overlooked anything...

You should be able to record the code with the macro recorder.

Greetings,
Klaus
 
W

Word Heretic

G'day "Klaus Linke" <[email protected]>,

<shrugs>

Seeing as I use 9 discrete tests to determine EOS I would guess you
have :)


Klaus Linke said:
You could try a wildcard replacement (check "Match wildcards"):
Find what: ([,.])([!0-9^32^13.])
Replace with: \1^32\2

In place of ^32, you can also simply type a space. I just used ^32 because a
space is easy to overlook.
^13 is the code of a paragraph mark, and I chose not to put in spaces if the
comma/dot appears in a number (... as Malcolm said, it could be a decimal
delimiter as in $1,345.32. And also, the replacement doesn't put spaces in
an "ellipsis" (= "...").

\1 is the comma or full stop (= the stuff in the first bracket), \2 the
following character.

You can read the replacement as "Look for a comma or full stop that isn't
followed by a number, or a space, or a ¶, or a full stop, and if you find
such a pair: put a space in between".

Hope I haven't overlooked anything...

You should be able to record the code with the macro recorder.

Greetings,
Klaus





Malcolm Smith said:
People forget to put a space after a full stop or a comma?

I think that you need to train people the rudiments of whatever
language your users are typing in more than giving them this
crutch to encourage their bad typing habits.

But, that doesn't solve the problems of older documents, does it?
Now, questions. What is your native language?

Does your language have the comma as the thousands separator
and the full stop (period) as the decimal point separator?

Regards
-Malc
www.dragondrop.com

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
Email (e-mail address removed)
Products http://www.geocities.com/word_heretic/products.html

Replies offlist may require payment.
 
T

Thejan Mendis

Hi

it seems to be okk but but its putting an extra space like this

abc.abc

after the macro

abc. a bc

OR

abc,abc

after the macro

abc, a bc


CAN YOU CORRECT THIS FOR ME

THEJAN



----- Original Message -----
From: "Klaus Linke" <[email protected]>
Newsgroups: microsoft.public.word.vba.beginners
Sent: Saturday, October 11, 2003 6:11 AM
Subject: Re: Identify sentences by WORD Macro

You could try a wildcard replacement (check "Match wildcards"):
Find what: ([,.])([!0-9^32^13.])
Replace with: \1^32\2

In place of ^32, you can also simply type a space. I just used ^32 because a
space is easy to overlook.
^13 is the code of a paragraph mark, and I chose not to put in spaces if the
comma/dot appears in a number (... as Malcolm said, it could be a decimal
delimiter as in $1,345.32. And also, the replacement doesn't put spaces in
an "ellipsis" (= "...").

\1 is the comma or full stop (= the stuff in the first bracket), \2 the
following character.

You can read the replacement as "Look for a comma or full stop that isn't
followed by a number, or a space, or a ¶, or a full stop, and if you find
such a pair: put a space in between".

Hope I haven't overlooked anything...

You should be able to record the code with the macro recorder.

Greetings,
Klaus





Malcolm Smith said:
People forget to put a space after a full stop or a comma?

I think that you need to train people the rudiments of whatever
language your users are typing in more than giving them this
crutch to encourage their bad typing habits.

But, that doesn't solve the problems of older documents, does it?
Now, questions. What is your native language?

Does your language have the comma as the thousands separator
and the full stop (period) as the decimal point separator?

Regards
-Malc
www.dragondrop.com
 
K

Klaus Linke

it seems to be okk but but its putting an extra space

Hi Thejan,

You probably added a space after the "Replace with:" text.

Greetings,
Klaus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top