Microsoft KB Archive/324330

= The FindRecord function incorrectly returns a result of False in Word 2002, in Word 2003, and in Word 2007 =

Article ID: 324330

Article Last Modified on 1/18/2007

-

APPLIES TO


 * Microsoft Word 2002 Standard Edition
 * Microsoft Office Word 2003
 * Microsoft Office Word 2007

-



This article was previously published under Q324330



SYMPTOMS
The FindRecord function may incorrectly return a result of False when you try to use the FindRecord function together with one of the following:
 * Microsoft Visual Basic for Applications and Microsoft Word 2002
 * Microsoft Visual Basic for Applications and Microsoft Office Word 2003
 * Microsoft Visual Basic for Applications and Microsoft Office Word 2007



CAUSE
This problem occurs when the FindRecord function is incorrectly implemented in the Visual Basic for Applications (VBA) macro. The FindRecord function is incorrectly implemented if you do not specify the Field option when you call the FindRecord function.

For example, this problem occurs when you run the following VBA macro: Sub MyFindRecord

ActiveDocument.MailMerge.DataSource.FindRecord (&quot;Text&quot;, &quot;Field_Name&quot;)

End Sub Note &quot; &quot; is the text that you search for, and &quot; &quot; is the field name of the data source that contains the text. The text that you search for and the field name that contains the text must be enclosed in quotation marks.



WORKAROUND
To work around this problem, use the following VBA macro: Sub MyFindRecord

ActiveDocument.MailMerge.DataSource.FindRecord (FindText:=&quot;Text&quot;, Field:=&quot;Field_Name&quot;)

End Sub Note &quot; &quot; is the text that you search for, and &quot; &quot; is the field name of the data source that contains the text. The text that you search for and the field name that contains the text must be enclosed in quotation marks.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.

Additional query words: VBE VBA

Keywords: kbbug kbpending KB324330

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.