List index out of bounds

  • I'm an user of WpTools version 3 with Delphi 6.

    I'd like to ask if someone has some tip to solve this problem: when I call the

    DBWPRichText1.PrinterSetup method I receive the following error message "List index out of bounds (6)."

    This error started when I recently installed a new printer on the network. On the control panel I have 6 printers.

    Does someone have any idea of how to resolve this problem?

    Thank you all.

    Regards,

    Marcelo Alaggio.
    Brazil

  • Hi Jeremy,

    thank you for your help.

    I'll try to give you a better explanation of the problem.

    In fact, I have 6 printers installed.

    I call DBWPRichText1.PrinterSetup method to select one of the printers available.

    Then I print the document, everything works fine.

    But, If I run the following code below, I notice that returns 7 (another
    instance of the printer I selected is created, not in the control pannel, just within the printer object). This happens only when I select a specific printer. This printer is a network printer, attached to another computer.

    ......
    StrListPrinters := TStringList.create;
    StrListPrinters.Assign(printer.printers);
    showmessage(StrListPrinters.Count);
    // this code shows "7" although I have only "6" printers

    Any idea would help a lot.

    Thank you again.

    Regards,

    Marcelo Alaggio.
    Porto Alegre - RS - Brazil