CATIA Automation 작성 시 폴더를 선택하는 창을 지정할 경우가 있다.
그 창을 띄우는 코드는 아래와 같이 작성하면 쉽게 띄울 수 있다.
Private Sub CommandButtonGetPLTFolder_Click()
Dim oShell
Dim oFolder
Dim oFolderItem
On Error Resume Next
Set oShell = CreateObject("Shell.Application")
Set oFolder = oShell.BrowseForFolder(0, "PLT를 저장할 폴더를 선택하세요.", 0)
If Not oFolder Is Nothing Then
Set oFolderItem = oFolder.Items.Item
Me.TextBoxPLTFolder.Text = oFolderItem.path
End If
CheckOK
End Sub
아래와 같이 폴더 지정 창을 선택 가능함