Thread: [Solved] Word VBA - Find
View Single Post
 
Old 04-15-2011, 08:51 AM
SDondeti SDondeti is offline Windows XP Office 2007
Novice
 
Join Date: Apr 2011
Posts: 7
SDondeti is on a distinguished road
Default Word VBA - Find

Hi,

Word VBA code was written in finding the word in a document and trying to get next word or characters after search word.

Example: In a sample.dotm, I am searching a word "Heading" in a forward=false which means up. I am able to find it and i want to know the next word or next characters after "Heading" using word vba.

Can some one help me out.

Here is the code i am trying to use:

Code:
With Selection.Find
  .text = "Heading"
  .Replacement.text = ""
  .Forward = True
  .Wrap = wdFindAsk
  .Format = False
  .MatchCase = True
  .MatchWholeWord = False
  .MatchWildcards = False
  .MatchSoundsLike = False
  .MatchAllWordForms = False
End With
Selection.Find.Execute
how to find the reference where the search word is found?

Thanks in advance.

SDondeti.
Reply With Quote