ListView Help

Discussion in 'AutoCAD' started by Lenny Louque, Feb 24, 2004.

  1. Lenny Louque

    Lenny Louque Guest

    I have a ListView control that has five colums. Each column has a DWG path,
    and four other properties. I am want to go through the list and get the DWG
    path and open the drawing do some stuff and then close it. here is what i
    have so far:

    Dim NumFiles As Integer
    Dim acadApp As AcadApplication
    Dim path As ListItem
    NumFiles = (lvFiles.ListItems.Count - 1)

    On Error Resume Next
    Set acadApp = GetObject(, "AutoCAD.Application.16")
    If Err Then
    Err.Clear
    Set acadApp = CreateObject("AutoCAD.Application.16")
    If Err Then
    MsgBox "Could not connect to AutoCAD"
    Exit Sub
    End If
    End If

    For i = 0 To NumFiles
    path = lvFiles.ListItems.Item(i)
    acadApp.Documents.Open (path)
    Next

    the path varibale is always null and the rows in the listview are filled
    with the information?

    Any help would be appricated

    Lenny
     
    Lenny Louque, Feb 24, 2004
    #1
  2. Try

    For i = 1 To lvFiles.Listitems.count
    path = lvFiles.ListItems.Item(i).text
    acadApp.Documents.Open (path)
    Next
     
    Jorge Jimenez, Feb 24, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.