GetShorty not worky for de \\companyweb

This question contains a combonation of Windows SBS 2003 sharepoint services and VB.

I drag a filename from a FileListBox to a PictureBox (the picturebox contains a picture of a pencil - this control is only used as a conduit for executing the editing process).  The OLEDragDrop event is fired and the sub loads the file into mspaint for editing.  This works fine for any long filenames and long directory names in "normal" directories (see GetShortFileName in your search), but we are now using folders in sharepoint services on a Windows 2003 Server (i.e.  \\companyweb\somedirectory).  Let's say we have a filepathname of  "\\companyweb\somefolder\some sub folder with spaces in the name\somefile.bmp".  Now the "shelled" mspaint app throws an error "\\companyweb\somefolder\some.bmp was not found."  It only takes up to the first space of the subfolder name (if there are spaces in the name), truncates, and then appends the .bmp.  It is as if there is no short name for the sharepoint folders.

This code works fine, including the GetShortFileName, but bombs in sharepoint \\companyweb\ folders:

Private Sub picEdit_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, Y As Single)
    Dim mhWndApp As Long
    Dim hInst As Long
    hInst = Shell("mspaint.exe " & GetShortFileName(Data.Files(1)), vbMaximizedFocus)
    mhWndApp = GetWinHandle(hInst)
    lR = SetTopMostWindow(mhWndApp, True)
End Sub

Why? And what's the solution?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Not sure what is going on with your GetShortFileName function or Sharepoint folders, but if you wrap the long path name in double quotes, there is no need to use the short name.

Dim hInst As Long
Dim filename As String
filename = "\\Michelle\SharedDocs\My Pictures\Sample Pictures\water lilies.jpg"
hInst = Shell("mspaint.exe " & Chr(34) & filename & Chr(34), vbMaximizedFocus)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tbmaciiiAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.