Looking for a hand. I have a vbscript that compares 2 files but the file paths have to be inputted direct to the file, looking to just get the browse function used for both files, can anyone help with that ?
Just do a split on them, but first link in google seems up your alley. http://www.devguru.com/Technologies/vbScript/quickref/file.html
Ive tried looking online, still no help, I can get one browse function integrated but not 2. one for each file, and for the script to keep the file and continue with script. here is the code... Dim objWord Dim objScript Dim strDocA Dim strDocB Dim fContinue 'Const vbExclamation = 48 strDocA = InputBox("Enter most recent HC Path & Filename", "Path to HC File") strDocB = InputBox("Enter previous HC Path & Filename", "Path to HC File") ' Assume that user passed valid paths fContinue = True ' Now, test file paths to DocA and DocB for validity ' -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Set objScript = CreateObject("Scripting.FileSystemObject") fContinue = objScript.FileExists(strDocA) fContinue = objScript.FileExists(strDocB) Set objScript = Nothing If fContinue = False Then MsgBox "Wrong Path to File - Come on!" ,vbExclamation ,"Error" Else ' Only continue if user has typed text into InputBox. Set objWord = CreateObject("Word.Application") objWord.Documents.Open strDocA objWord.ActiveDocument.Compare strDocB objWord.Visible = True Set objWord = Nothing End If