I'm developing a code that needs to deal with
different printer user formats which have to be
created on a network driver printer (OKI 321).
The big issue I am finding is that the printer doesn't
allow me to handle with more than 1 defined format at
the same time. We could say it allows me to define
just ONE format at a time (and it is going to work
with the last format I set), even though the settings
are being defined either manually -at the printer
server- or with the given code seen below.
In addition, when I use that code, it will not work
when the printer is not physically connected to the
computer.
'Code used to get the type of paper
For Each PaperSize In
PrintDoc.PrinterSettings.PaperSizes
If
PaperSize.PaperName.IndexOf(oDSInfo.Tables(0).Rows (0)("NombrePapel"))
= 0 Then
Encontrado = True
Exit For
End If
Next
'If PaperSize was not found, I call this function
'which creates the adequate paper size at the printer
MJMCustomPrintForm.MJMCustomPrintForm.AddCustomPap erSize(PrinterName,
"_jf" & oDSInfo.Tables(0).Rows(0)("PaperName") &
vbNullString, rPagina.Width, rPagina.Height)
PrintDoc.DefaultPageSettings.PaperSize = PaperSize
PrintDoc.PrinterSettings.DefaultPageSettings.Paper Size
= PaperSize
However, even though I set the correct Papersize if
there is more than one personalized format set, it
only will take the last format defined.
Can anybody help me, please?
Thank you very much in advance ...!