dcsimg
Results 1 to 3 of 3

Thread: list7 additem ( adding unwanted items)

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2019
    Posts
    51

    list7 additem ( adding unwanted items)

    Code:
    Set ShellClass = New Shell32.Shell
    Set sh = CreateObject("shell.application")
    Set nn = sh.NameSpace(Text13.text)
    
    For Each ii In nn.Items
    Set n = sh.NameSpace(Text13.text & ii)
    
    
    For Each i In n.Items
    For ctr = List3.ListCount - 1 To 0 Step -1
        'Debug.Print i
        If InStr(i, List3.List(ctr)) Then
        counterr = counterr + 1
        List7.AddItem i
        
        End If
    Next
    my list item's that gets added can be any type of file and extensions and some files do not have extensions.
    so for example list list3 has
    Code:
    e0
    e6
    e5
    e4
    e1
    e66
    e99
    it adds these files from Text13.text' path to the temp files.
    Code:
    e51-01.4
    82s129.4a
    e5.6
    e51-10.18
    along with the files above into list7.

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    24,438

    Re: list7 additem ( adding unwanted items)

    instr does not provide an exact match, only if the string contains the second string, three of the files contain e5 so would match, not sure about #2 in the list, i don't see why it should match from the lists given
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    Member
    Join Date
    Aug 2019
    Posts
    51

    Re: list7 additem ( adding unwanted items)

    delete this post.
    Last edited by doberman2002; Sep 9th, 2019 at 06:40 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width