Della,
Thanks for the reponse. This makes a lot of sense and I had kinda come to a conclusion along these lines, just didn't quite know how to go about it. However, I must still be missing something. While it no longer blows up, it isn't finding the text variables on the document. Any ideas?
Thanks,
Kevin
>The reason you're missing the text boxes is that
>
NewRange = oWord.ActiveDocument.Content
>refers to all the text in the main "story." It doesn't include text in other "stories," such as headers, footers, and shapes (meaning text boxes).
>
>To search the text in text boxes, access the TextFrame story:
>
#DEFINE wdTextFrameStory 5
>NewRange = oDoc.StoryRanges(wdTextFrameStory)
>
>Then your code, shown below, should work fine.
>
>
>With NewRange.Find
>> .ClearFormatting
>> .Forward = .T.
>> .Text = "!lcActNbr!"
>> .Execute
>> If .Found
>> NewRange.Text = ALLTR(ltrctr.act_nbr)
>> EndIf
>>EndWith
>
> - della