Is anyone good with VBscript ?

Discussion in 'Programming' started by -jay-, Dec 2, 2009.

  1. #1
    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 ?
     
    -jay-, Dec 2, 2009 IP
  2. Brandon Sheley

    Brandon Sheley Illustrious Member

    Messages:
    9,721
    Likes Received:
    612
    Best Answers:
    2
    Trophy Points:
    420
    #2
    Have you tried using MS visual studios? or google for the answer
     
    Brandon Sheley, Dec 2, 2009 IP
  3. ecigazon

    ecigazon Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ecigazon, Dec 2, 2009 IP
  4. -jay-

    -jay- Well-Known Member

    Messages:
    2,311
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    160
    #4
    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
     
    -jay-, Dec 3, 2009 IP