S
stevewy
This is a request for some help programming a short, but rather odd,
Word macro.
I have a large Word table of four columns, extracted from a database,
and the fourth column contains text up to 2,100 characters long. I
need to spell check this fourth column of text, then import it all back
into the database (which doesn't have its own spell checker).
The trouble is, after I have spell checked the text, some cells are
liable to be slightly longer or slightly shorter than they were
originally, due to the spell check corrections, and may even run over
the 2,100 character limit. If I am to succesfully import the text back
into the database after spell checking, I would need to adjust the
defined limit for the text in the database. So I need to tell if the
2,100 limit gets exceeded after the spell checking.
I need a little macro that, once I have selected the entire column,
will work down each cell in the selection, and count the amount of
characters in each cell. Word will already do this manually
cell-by-cell using the "Word Count" function in the Tools menu, so
obviously this property exists in Word, but I am not certain how to
access it from VBA "in bulk".
The macro will only need to keep a track of the amount of characters in
the longest cell found, so it only needs to give me a "maximum" total
at the end of the macro play.
So at the end of the counting, a message box would pop up saying
"Longest amount of characters in any one cell = 2,227 characters", or
whatever.
Could anyone help with a small macro that would accomplish this? Many
thanks.
Steve Wylie
Canterbury,
United Kingdom
Word macro.
I have a large Word table of four columns, extracted from a database,
and the fourth column contains text up to 2,100 characters long. I
need to spell check this fourth column of text, then import it all back
into the database (which doesn't have its own spell checker).
The trouble is, after I have spell checked the text, some cells are
liable to be slightly longer or slightly shorter than they were
originally, due to the spell check corrections, and may even run over
the 2,100 character limit. If I am to succesfully import the text back
into the database after spell checking, I would need to adjust the
defined limit for the text in the database. So I need to tell if the
2,100 limit gets exceeded after the spell checking.
I need a little macro that, once I have selected the entire column,
will work down each cell in the selection, and count the amount of
characters in each cell. Word will already do this manually
cell-by-cell using the "Word Count" function in the Tools menu, so
obviously this property exists in Word, but I am not certain how to
access it from VBA "in bulk".
The macro will only need to keep a track of the amount of characters in
the longest cell found, so it only needs to give me a "maximum" total
at the end of the macro play.
So at the end of the counting, a message box would pop up saying
"Longest amount of characters in any one cell = 2,227 characters", or
whatever.
Could anyone help with a small macro that would accomplish this? Many
thanks.
Steve Wylie
Canterbury,
United Kingdom