P
pkirill
I had a great little program all worked out in VB6. Then when I tried to
port it into VBA I found that VBA doesn't support checkbox style list boxes
(??). So I began rewriting and have this question:
Why is it that the code below will work on a VBA list box designated as
frmMultiSelectSingle but not when designated as frmMultiSelectMulti or
Extended?
All I want is for a drawing preview and some summary information to show in
my form as I select list items....
Thanks for any help... I'm very confused...
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Option Explicit
Option Compare Text
Public strPath As String
Public sFileName As String
Private Sub cmdCancel_click()
Unload formLegendBuilder
End
End Sub
Private Sub List1_Click()
If TabStrip1.SelectedItem.Caption = "DUCT" Then
strPath = "G:\CAD Standards\HCYU Standards\Research & Development\HVAC
Legend\PSSL\"
sFileName = strPath & List1.Text & ".dwg"
InfoDisplay
End If
End Sub
'Private Sub TabStrip1_Click()
'MsgBox TabStrip1.SelectedItem.Caption
'End Sub
Private Sub UserForm_initialize()
Dim objFSO As Scripting.FileSystemObject
Dim objFolder As Scripting.Folder
Dim objFile As Scripting.File
frmColumnTtl.Caption = "Number of Columns: " & sldColumns.Value
Set objFSO = New Scripting.FileSystemObject
Set objFolder = objFSO.GetFolder("G:\CAD Standards\HCYU Standards\Research &
Development\HVAC Legend\PSSL\")
For Each objFile In objFolder.Files
If objFile.Name Like "*.dwg" = True Then
List1.AddItem Mid(objFile.Name, 1, (Len(objFile.Name) - 4))
Dim i As Scripting.File
End If
Next objFile
formLegendBuilder.Show
End Sub
Public Sub InfoDisplay()
Dim oThumb As DwgThumbnail
Dim dwgProps As DWGPROPSXLib.Properties
Set dwgProps = New DWGPROPSXLib.Properties
dwgProps.Load sFileName
If Len(dwgProps.Title) > 0 Then
lblLegendText.Caption = (UCase(dwgProps.Title))
Else
lblLegendText.Caption = "N\A"
End If
If Len(dwgProps.Comments) > 0 Then
lblBlkDescription.Caption = (dwgProps.Comments)
Else
lblBlkDescription.Caption = "No drawing summary data available."
End If
DwgThumbnail1.DwgFileName = sFileName
End Sub
port it into VBA I found that VBA doesn't support checkbox style list boxes
(??). So I began rewriting and have this question:
Why is it that the code below will work on a VBA list box designated as
frmMultiSelectSingle but not when designated as frmMultiSelectMulti or
Extended?
All I want is for a drawing preview and some summary information to show in
my form as I select list items....
Thanks for any help... I'm very confused...
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Option Explicit
Option Compare Text
Public strPath As String
Public sFileName As String
Private Sub cmdCancel_click()
Unload formLegendBuilder
End
End Sub
Private Sub List1_Click()
If TabStrip1.SelectedItem.Caption = "DUCT" Then
strPath = "G:\CAD Standards\HCYU Standards\Research & Development\HVAC
Legend\PSSL\"
sFileName = strPath & List1.Text & ".dwg"
InfoDisplay
End If
End Sub
'Private Sub TabStrip1_Click()
'MsgBox TabStrip1.SelectedItem.Caption
'End Sub
Private Sub UserForm_initialize()
Dim objFSO As Scripting.FileSystemObject
Dim objFolder As Scripting.Folder
Dim objFile As Scripting.File
frmColumnTtl.Caption = "Number of Columns: " & sldColumns.Value
Set objFSO = New Scripting.FileSystemObject
Set objFolder = objFSO.GetFolder("G:\CAD Standards\HCYU Standards\Research &
Development\HVAC Legend\PSSL\")
For Each objFile In objFolder.Files
If objFile.Name Like "*.dwg" = True Then
List1.AddItem Mid(objFile.Name, 1, (Len(objFile.Name) - 4))
Dim i As Scripting.File
End If
Next objFile
formLegendBuilder.Show
End Sub
Public Sub InfoDisplay()
Dim oThumb As DwgThumbnail
Dim dwgProps As DWGPROPSXLib.Properties
Set dwgProps = New DWGPROPSXLib.Properties
dwgProps.Load sFileName
If Len(dwgProps.Title) > 0 Then
lblLegendText.Caption = (UCase(dwgProps.Title))
Else
lblLegendText.Caption = "N\A"
End If
If Len(dwgProps.Comments) > 0 Then
lblBlkDescription.Caption = (dwgProps.Comments)
Else
lblBlkDescription.Caption = "No drawing summary data available."
End If
DwgThumbnail1.DwgFileName = sFileName
End Sub