Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    482
    Thanks
    43
    Thanked 0 Times in 0 Posts

    Check for network (WinXP OXP)

    I wish to include code in a macro under Word to check if there is a network present and if so to set a printer as the ActivePrinter. I have looked all over and have not found any info on how to do this.

    Can anyone help?
    cheers

    Phil Carter

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

    Re: Check for network (WinXP OXP)

    Have a look here and see if it helps.

    Andrew C

  3. #3
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Jeddah, Saudi Arabia
    Posts
    243
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Check for network (WinXP OXP)

    On our network, a user has a network drive mapped when the user logs in, in our case drive H.

    What I do to check if the network is available is simply to call this function:

    Function NetworkIsThere() as Boolean
    Dim sDir as String

    sDir=Dir("H:", vbDirectory)

    If sDir = vbNullString then
    NetworkIsThere=False
    Else
    NetworkIsThere=True
    Endif

    End Function

    I realise this will only work if drives are mapped but for me it works fine with no API calls or foreign DLLs.

    Regards,

    Kevin Bell

  4. #4
    4 Star Lounger
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    482
    Thanks
    43
    Thanked 0 Times in 0 Posts

    Re: Check for network (WinXP OXP)

    Kevin

    Thanks very much eaxctly what I was looking for. Coincidentely our most common mapped drive is also H:.

    Thanks again and Happy New Year
    cheers

    Phil Carter

Posting Permissions

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