D
DS
I'm Running this code and I get an Error 7777
saying that I used the ListIndex incorrectly. After I click end It
shows the Printer attached in the combo box. What am I doing wrong?
Thanks
DS
Private Sub Form_Load()
'Add each printer installed to the combo box list
Dim X As Printer
Dim rtn As Long
Dim Driver As String
Dim I As Integer
m_ESCNFlg = False
For Each X In Printers
rtn = GetPrnDriverName(X.DeviceName, Driver)
If rtn <> 0 Then
Driver = ""
End If
If InStr(Driver, "EPSON TM") <> 0 Or _
InStr(Driver, "EPSON RP") <> 0 Or _
InStr(Driver, "EPSON EU") <> 0 Or _
InStr(Driver, "EPSON BA") <> 0 Then
CmbPrn.AddItem (X.DeviceName)
End If
Next
If CmbPrn.ListCount <> 0 Then
CmbPrn.ListIndex = 0
End If
rtn = GetPrnDriverName(CmbPrn.Text, Driver)
If rtn <> 0 Then
Driver = ""
End If
If Driver = DRV_NAME_TMH6000II_ENDORSE Then
ButnESCNEnable.Enabled = True
Else
ButnESCNEnable.Enabled = False
End If
End Sub
saying that I used the ListIndex incorrectly. After I click end It
shows the Printer attached in the combo box. What am I doing wrong?
Thanks
DS
Private Sub Form_Load()
'Add each printer installed to the combo box list
Dim X As Printer
Dim rtn As Long
Dim Driver As String
Dim I As Integer
m_ESCNFlg = False
For Each X In Printers
rtn = GetPrnDriverName(X.DeviceName, Driver)
If rtn <> 0 Then
Driver = ""
End If
If InStr(Driver, "EPSON TM") <> 0 Or _
InStr(Driver, "EPSON RP") <> 0 Or _
InStr(Driver, "EPSON EU") <> 0 Or _
InStr(Driver, "EPSON BA") <> 0 Then
CmbPrn.AddItem (X.DeviceName)
End If
Next
If CmbPrn.ListCount <> 0 Then
CmbPrn.ListIndex = 0
End If
rtn = GetPrnDriverName(CmbPrn.Text, Driver)
If rtn <> 0 Then
Driver = ""
End If
If Driver = DRV_NAME_TMH6000II_ENDORSE Then
ButnESCNEnable.Enabled = True
Else
ButnESCNEnable.Enabled = False
End If
End Sub