Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    London, Gtr London, England
    Posts
    416
    Thanks
    0
    Thanked 0 Times in 0 Posts

    HELP! IF and TOC (for tables/figures) (WORD 97/2000)

    My apologies if I am being totally stupid. Correct me if I am doing something wrong here please. Thanks.

    I am trying to create a template that has a list of tables and figures. But I only want the list of tables/figures to appear if any are defined (using the Insert | Caption menu option). I don't want WORD to display an error message "Error! No table of figures entries found.". However, I am unable to SUPPRESS the error message! I am using an IF construction to achieve this but it's not working.

    This is what I have in my template.

    Contents
    { TOC o "1-2" h z }

    List of Figures
    { IF { TOC h z c "Figure" } = "Error! No table of figures entries found." " " { TOC h z c "Figure" } }

    List of Tables
    { IF { TOC h z c "Table" } = "Error! No table of figures entries found." " " { TOC h z c "Table" } }

    Robie
    Thanks.
    Robie

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: HELP! IF and TOC (for tables/figures) (WORD 97/2000)

    Hi Robie:

    I don't think you can do this with an IF field. The field doesn't really equal "Error! No table etc...". That's just an error message displayed when there are no figures.

    You can't do it with this either:
    { if { toc h z c "Figure" } = "" "" { toc h z c "Figure" } }

    Nor can you do it with
    { if { toc h z c "Figure" } <> "" { toc h z c "Figure" } "" }

    I think you need to use a macro that would insert the field when figures exist & suppress the error message when it doesn't exist. However, I'm afraid that I don't know how to do that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •