Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts

    Network Connection: Word / Win 2000 (Word 97)

    There's a documented bug in Windows 2000 which causes problems with Print to File when the drive letter of the output file path is a mapped network drive. To resolve the problem, I need to convert the specified drive letter to its UNC value. I understand there's a function called wGetNetConnection (or something similar to that), but I can't find any info on it. I want to pass a drive letter to a function and have it return the UNC value for the network connection.

    Thanks,
    Richard Barrett

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Network Connection: Word / Win 2000 (Word 97)

    If you don't find the Windows function, you can do this:
    <pre>Function GetShareFromDriveLetter(strDriveLetter As String) As String
    ' Jefferson Scher 2-7-02
    ' This requires a reference to the Microsoft Scripting Runtime
    ' Access the Drive object through the FileSystemObject
    Dim oFSO As New FileSystemObject
    On Error Resume Next
    GetShareFromDriveLetter = oFSO.Drives(strDriveLetter).ShareName
    If Err.Number <> 0 Then
    ' Most likely, the letter is not mapped or media was removed
    GetShareFromDriveLetter = vbNullString
    End If
    Set oFSO = Nothing
    End Function</pre>


  3. #3
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts

    Re: Network Connection: Word / Win 2000 (Word 97)

    Thanks very much. I'll give this a try.

    Richard

Posting Permissions

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