View Single Post
  #2   Report Post  
Klaus Linke
 
Posts: n/a
Default

"Lily" wrote:
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