I can't remember where I got this code but I believe it was one of those VB Snippet sites. But I have attached the code behind a module I use to map/unmap drives using UNC paths. The method ConnectUNC will not only map the drive but it returns the drive letter it created so you can know what drive letter to reference.
The code will also locate an available drive letter to use so that you don't have to "tell" it what letter to use. It starts with Z and works backwards until it finds an available drive letter.