WD: AUTONUM Field Doesn't Work with IF Statement in WinWord (78935)



The information in this article applies to:

  • Microsoft Word for Windows 2.0
  • Microsoft Word for Windows 2.0a
  • Microsoft Word for Windows 2.0b
  • Microsoft Word for Windows 2.0c
  • Microsoft Word for Windows 6.0
  • Microsoft Word for Windows 6.0a
  • Microsoft Word for Windows 6.0c
  • Microsoft Word for Windows 95
  • Microsoft Word for Windows 95 7.0a
  • Microsoft Word 97 for Windows

This article was previously published under Q78935

SUMMARY

In Microsoft Word for Windows, using an IF statement in a field removes the numeric value that is created by a nested AUTONUM field. In Word 7.x and 97 you get the following error message instead of no result:
Error! Unknown Op code for conditional.

MORE INFORMATION

This problem also occurs if you nest an INCLUDE field within an IF statement and the included file contains AUTONUM fields. You cannot change this behavior because the IF field evaluation always produces the result text. All nested fields are evaluated, and nested field instructions are not preserved.

Steps To Reproduce Problem

  1. Press CTRL+F9 to insert the field braces.
  2. Type if 1 = 1. From the Insert menu, choose Field, and select Auto No. Choose the OK button.
  3. Insert quotation marks around the nested AUTONUM field. The completed field should appear as follows:

    {if 1 = 1 "{autonum}"}

  4. Select the entire field, and press F9. If field codes are displaying, press SHIFT+F9 to display the field results. This field returns no result.

STATUS

Microsoft is researching this problem and will post new information here as it becomes available.

Modification Type:MinorLast Reviewed:8/16/2005
Keywords:kbfield kbualink97 kbusage KB78935