Not sure of how to through iLogic....
But here's some VBA stuff to get you on the right track...Folder Dialog
Dim pathSelected As String 'Allows the user to select a folder
Dim ShellApp As Object
Set ShellApp = CreateObject("Shell.Application"). _
BrowseforFolder(0, "Choose Folder", 0, OpenAt)
pathSelected = ShellApp.self.path
Me.TextBox1.Text = pathSelected
Set ShellApp = Nothing
OpenFileDialog:
Public Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
Public Type OPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As String
nMaxCustFilter As Long
nFilterIndex As Long
lpstrFile As String
nMaxFile As Long
lpstrFileTitle As String
nMaxFileTitle As Long
lpstrInitialDir As String
lpstrTitle As String
flags As Long
nFileOffset As Integer
nFileExtension As Integer
lpstrDefExt As String
lCustData As Long
lpfnHook As Long
lpTemplateName As String
End Type
Public Function SelectFileOpenDialog()
Dim strTemp, strTemp1, pathStr As String
Dim i, n, j As Long
Dim OpenFile As OPENFILENAME
Dim lReturn As Long
Dim sFilter As String
Dim Fname As String
OpenFile.lStructSize = Len(OpenFile)
sFilter = "Assembly Files (*.iam)" & Chr(0) & "*.IAM" & Chr(0)
OpenFile.lpstrFilter = sFilter
OpenFile.nFilterIndex = 1
OpenFile.lpstrFile = String(257, 0)
OpenFile.nMaxFile = Len(OpenFile.lpstrFile) - 1
OpenFile.lpstrFileTitle = OpenFile.lpstrFile
OpenFile.nMaxFileTitle = OpenFile.nMaxFile
OpenFile.lpstrInitialDir = dir_path
OpenFile.lpstrTitle = "Select An Assembly"
OpenFile.flags = 0
lReturn = GetOpenFileName(OpenFile)
If lReturn = 0 Then
MsgBox "No file selected. Please try again."
Else
Fname = Trim$(OpenFile.lpstrFile) ' Copies the filename to "Fname"
n = FileLen(OpenFile.lpstrFile) 'Length of the file
Resolve_and_Open.FileName.Text = Fname
End If
End Function
A code I use, using filesystemobject, to copy contents of a folder to another folder...
Option Explicit
Sub Folder_Testing()
Dim path As String
If Dir("C:\\InventorTempFolder\\\", vbDirectory) = "" Then 'Creates a new temporary directory path for a folder copy
MkDir "C:\\InventorTempFolder\\\"
SetAttr "C:\InventorTempFolder", vbNormal
Else: MsgBox "Please delete the C:\InventorTempFolder and restart program."
End If
Dim FSO As Object
Dim FromPath As String
Dim ToPath As String
FromPath = Browser.TextBox1.Text
ToPath = "C:\\InventorTempFolder\\\"
If Right(FromPath, 1) = "\" Then
FromPath = Left(FromPath, Len(FromPath) - 1)
End If
If Right(ToPath, 1) = "\" Then
ToPath = Left(ToPath, Len(ToPath) - 1)
End If
Set FSO = CreateObject("scripting.filesystemobject")
If FSO.FolderExists(FromPath) = False Then
MsgBox FromPath & " does not exist. Please restart process."
Exit Sub
End If
FSO.CopyFolder Source:=FromPath, Destination:=ToPath 'Copies the folder and all its files in to the new temporary directory path
End Sub
A code I use, using filesystemobject, to delete a directory:
Option Explicit
' Delete this directory and all the files it contains.
Sub DeletetheDirectory()
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.deletefolder "C:\\InventorTempFolder"
On Error Resume Next
End Sub
Hope this gets you on the right track!