VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GetOpenFilename - MultiSelect = TRUE

0 REPLIES 0
Reply
Message 1 of 1
nuelss
1397 Views, 0 Replies

GetOpenFilename - MultiSelect = TRUE

Hello gentlemen:

I have been seeing here at the forum you vary explanations on OPENING FILE (Dialog...)

But when it is MULTISELECT=TRUE, the box dialogues it is different from MULTISELECT=FALSE...

A code that I adapted for my needs in EXCEL, proceeds it would like somebody to turn possible your execution in AutoCAD...

Test in Excel to see the operation...


''''''''''''''''''''''''''' It follows the Code... '''''''''''''''''''''''''

''sub routine to extract the name of the directory...
Function FolderName(InputString As String, ReturnFileName As Boolean) As String
Dim i As Integer
i = 0
While InStr(i + 1, InputString, Application.PathSeparator) > 0
i = InStr(i + 1, InputString, Application.PathSeparator)
Wend
FolderName = Left(InputString, i - 1)
End Function

''Main routine
Sub ListFiles()
Dim filexlsimport As Variant
Dim i As Integer
Dim r As Integer
Dim path As String
Dim listfiles As String
path = ""
listfiles = ""
r = 1
filexlsimport = Application.GetOpenFilename("Drawing Files (*.dwg), *.dwg", , "Select the drawings to list", , True)
On Error Resume Next
If Left(CVar(filexlsimport), 1) <> "F" Then
For i = 1 To UBound(filexlsimport)
If path = "" Then
path = FolderName(CStr(filexlsimport(i)), False) & "\"
End If

If r = 1 Then
listfiles = "(list" & listfiles & " " & Chr(34) & CStr(filexlsimport(i)) & Chr(34)
Else
listfiles = listfiles & " " & Chr(34) & CStr(filexlsimport(i)) & Chr(34)
End If
r = r + 1
Next i
listfiles = listfiles & ")"
MsgBox listfiles
End If
End Sub
''''''''''''''''''''''''''''''''''''''''''''' end of routine ''''''''''''''''''''''''''''''''''''''''''

Thank you!
Emanuel
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost