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
List index out of bounds
-
-
Sounds like you have 7 printers and are trying to access a list that has only 6 items. tstringlists etc. are 0-based, so mylist[6] is the seventh item.
-
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" printersAny idea would help a lot.
Thank you again.
Regards,
Marcelo Alaggio.
Porto Alegre - RS - Brazil -
have you tried the following before your assign?
printers.Printer.Refresh;
It does sound like a problem in wptools or in gprinter.
-
Hi Jeremy
what really solved the problem was the following:
printer.refresh;
printer.printerindex:=0Thank you for your assistance.
Regards,
Marcelo Alaggio.
Porto Alegre - RS - Brazil