How to find End-of-Row marker

L

Lily

Hi
Im a workig on VBA.
im looking for the word 'table' at the begining of the paragraph by
using the phrase '^13Table' with wilcards ON.
But sometimes the word 'table' occures immediately below the table.

Pls suggest me how to identify the word 'table' in such suituation

Thanx
Lily
 
K

Klaus Linke

Lily said:
Hi
Im a workig on VBA.
im looking for the word 'table' at the begining of the paragraph by
using the phrase '^13Table' with wilcards ON.
But sometimes the word 'table' occures immediately below the table.

Pls suggest me how to identify the word 'table' in such suituation

Thanx
Lily


Hi Lily,

Unfortunately, the end-of-cell and end-of-row markers are invisible to "Edit >
Find".

You need a work-around, like searching for "Table" and then checking the
previous character:
If AscW(Selection.Characters.First.Previous) = Chr(13) Then '...

Or loop the paragraphs collection in the first place (and check the left 5
letters) instead of using Find.

Or read the document in a variant (doctext = ActiveDocument.Content.Text), use
Split(doctext, Chr(13)), and then look at the 5 left letters of each item in the
array (If Left(doctext(i),5) = "Text" Then).
The array index i will still be the same as the paragraph index in the document,
so you can modify the corresponding paragraph.

What will be fastest depends on your documents.

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