DELETAR LINHA NO TXT EM VB6

WILLIANRC 08/12/2022 09:10:00
#500864
Ola pessoal ,
Estou com difculdade em deletar o valor buscado em um arquivo de Texto (.txt)
Eu fiz ele em VBA e super funcionou, porém estou tentando fazer em VB6 e nao estou conseguindo achar uma soluçao.

Em meu codigo de deletar quando clico aparece esta mensagem :
Compile error:
Method or data member not found
na linha :
 If Me.ListView1.ListIndex  

Alguem consegue me ajudar a deletar o registro no arquivo txt?
Segue o codigo de deletar e o projeto em anexo:

  
Private Sub DeleteData() " DELETE DATA

Call Pathway(way) "SET FOLDER WAY
Dim i As Long, ii As Long, n As Long, txt As String
If Me.ListView1.ListIndex = -1 Then Exit Sub
X(Me.ListView1.ListIndex) = Chr(1)
X = Filter(X, Chr(2), 0)
If UBound(X) > -1 Then
txt = Join(X, vbNewLine)
Else
X = Empty
End If
Open (way & "\users.txt") For Output As #1
Print #1, txt;
Close #1

Call PopulateListview
End Sub


Agradeço qualquer ajuda.
Faça seu login para responder