Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Aug 2003
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Validating Filepath (word 2000 )

    How do i validate a filepath for Documents in Word?

    Thanks...

  2. #2
    Lounger
    Join Date
    Aug 2003
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Validating Filepath (word 2000 )

    Ok i found out how to do it, but it does not work <img src=/S/bash.gif border=0 alt=bash width=35 height=39>

    documentsfilepath = Options.DefaultFilePath(wdDocumentsPath)
    Set fs = CreateObject("Scripting.FileSystemObject")
    b_driveexists = fs.DriveExists(documentsfilepath)

    Unfortunately, whatever path i set for the Documents in Tools->Option->File Location, I always get b_driveexists = False...

    What am I doing wrong?

  3. #3
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Validating Filepath (word 2000 )

    A bit of trial and error shows that
    b_driveexists = fs.DriveExists("C:")
    returns true, but
    b_driveexists = fs.DriveExists("C:Program Files")
    returns false

    I suspect that you will need to split the documentsfilepath string to give you just the but before the first

    StuartR

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Validating Filepath (word 2000 )

    What you need is

    fs.FolderExists

    instead of or in addition to fs.DriveExists

    Andrew C

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •