That's really quite simple. You should spend a little time studying Word's API.
That's really quite simple. You should spend a little time studying Word's API.
Cheers
Paul Edstein
[Fmr MS MVP - Word]
Hi
I was thinking of using
, but it's currently using With .Find.Find(What=SearchWord)
Trying to make it look for Exact Word, if there are multiple similar words like :Apple, apple, Red Apple, red apple, I want it to make the SearchWord = "Apple" and get only that one for example. I think that would be called to find the Exact Match
This would take more time, so it's not viable, have to try with the .Find function for the Exact match
EDIT:If InStr(TblCell.Range, SearchWord) Then
Did as below, find the MatchCase as Apple, but it doesen't go to the last result, it stops to the 1st encountered one, any idea how this can be done such as reaching the last found result? I've tried .Forward = True
Dim SearchWord As String SearchWord = "Apple" For Each wdTbl In .Tables With wdTbl.Range With .Find .Text = SearchWord .MatchCase = True .MatchWholeWord = True .Forward = True .Wrap = wdFindStop .Execute End With If .Find.Found = True Then WkSht.Range("A" & 1).Value = Split(wdTbl.Cell(.Cells(1).RowIndex, .Cells(1).ColumnIndex+1).Range.Text, vbCr)(0) Exit For End If End With Next
Last edited by johngalvin; 09-30-2019 at 05:40 AM.