31 January 2020
- Last edited 31 January 2020
Many thanks for the fantastic speedy reply. I've put in the script block and pointed the script to the vbs file on my D drive. I think I'm missing how to get the folder path (FOLDER_PATH) out of the script as when I look in the log it states:
File destination path: '%FOLDER_PATH%\R2018.pdf'
So the file name is correct but the path is not. For the Windows File System output folder I have put %FOLDER_PATH%
Here is the script:
on error resume next
Dim objFolder, objFSO, objSubFolder, iFolders
Set objFSO = CreateObject("Scripting.FileSystemObject")
iFolders = 0
'variable = "ABC"
variable = Metadata.Values("TRAVIS_HAW_REF")
Set objFolder = objFSO.GetFolder(strPath)
For Each objSubFolder In objFolder.SubFolders
If (StrComp(objSubFolder.Name,variable) = 0) Then
call Application.Log(99, "Folder Found: " & objSubFolder.Path)
call Metadata.SetValues("FOLDER_PATH", objSubFolder.Path)
msgbox("Folder Found: " & objSubFolder.Path)
If Err.Number <> 0 Then
msgbox "Error in CheckFolders:" & Err.Description
call Application.Log(99, "Error in CheckFolders:" & Err.Description)
Can you see what I've done incorrectly?