I am not sure what you mean by "I got a document which has several separate
documents". However, I hope the macro below will help you.
The macro works on the active document. You do not tell in which way you
want the words to be marked. The macro will apply yellow highlight.
The macro will find the first occurrence of “Ascane†written with uppercase
A exactly as here. If you want to find the word regardless of the use of
uppercase and lowercase, remove the line “.MatchCase = True†from the macro.
Sub MarkWordAscane()
Dim oTable As Table
Dim strWord As String
'The word to find
strWord = "Ascane"
'Set highlight color to yellow
Options.DefaultHighlightColorIndex = wdYellow
'Check each table in the document
For Each oTable In ActiveDocument.Tables
'Find out whether strWord is found - keep the start position
With oTable.Range.Find
.Text = strWord
.Forward = True
.Wrap = wdFindStop
.MatchCase = True
.Replacement.Highlight = True
'make only one replacement in each table
.Execute Replace:=wdReplaceOne
End With
Next oTable
End Sub
If you need help on installing a macro, see:
http://word.mvps.org/faqs/macrosvba/CreateAMacro.htm
--
Regards
Lene Fredborg - Microsoft MVP (Word)
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word