Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Sub BrowseFolder
Const OverWrite = True
Dim destpath, srcFiles
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder(0, "Example", 16384,"Computer")
If objFolder Is Nothing Then
Wscript.Quit
End If
ActiveDocument.Variables("vFileName").SetContent objFolder.title, true
ActiveDocument.Variables("vFolderName").SetContent objFolder.self.path, true
MsgBox "folder: " & objFolder.title & " Path: " & objFolder.self.path
End Sub
Above macro codes working fine for excel, i need to browse csv file so kindly guide me.
Regards,
Zain.
Sub CopyFile
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
srcFiles = ActiveDocument.Variables("vFolderName").GetContent.String
destPath = "c:\"
fso.CopyFile srcFiles,destPath, True
set vLog = ActiveDocument.Variables("vLog")
content = vLog.GetContent.String
vLog.SetContent Now & " File "& chr(34) & file & chr(34) &" copied the File successfully by SIVA from " & srcFiles & "To the folder" &destPath & chr(34) & chr(34) & vbCr & vbLf & content, true
ActiveDocument.Save
Msgbox("copy file Complete!")
MsgBox "File successfully copied by SIVA from " & srcFiles & "To c:\"
Kindly check above code to copy file, above code define after browse code can you plz check here need to any change.