Signature (Visual Basic / VBA)
Public Function CombineDriveAndPath( _
ByVal vDrive As Variant _
, ByVal vPath As Variant _
) As Variant
Code Example
CombineDriveAndPath("C", "WINDOWS") = "C:WINDOWS" ' #1; Note no \
CombineDriveAndPath("C", "\WINDOWS") = "C:\WINDOWS" ' #2; Note C to C:
CombineDriveAndPath("C:", "WINDOWS") = "C:WINDOWS" ' #3; Note no \
CombineDriveAndPath("C:", "\WINDOWS") = "C:\WINDOWS"
CombineDriveAndPath("C:\", "WINDOWS") = "C:\WINDOWS"
CombineDriveAndPath("C:\", "\WINDOWS") = "C:\WINDOWS"
CombineDriveAndPath("\\SJS4", "ENTISOFT") = "\\SJS4\ENTISOFT"
CombineDriveAndPath("\\SJS4", "\ENTISOFT") = "\\SJS4\ENTISOFT"
CombineDriveAndPath("\\SJS4\", "ENTISOFT") = "\\SJS4\ENTISOFT"
CombineDriveAndPath("\\SJS4\", "\ENTISOFT") = "\\SJS4\ENTISOFT"
Parameters
| Parameter | Description |
|---|---|
| vDrive | Drive letter or UNC drive name that will be combined with vPath. Function returns Null if vDrive is Null or cannot be fixed-up to a string. |
| vPath | Path portion of a file name that will be combined with vDrive. Function returns Null if vPath is Null or cannot be fixed-up to a string. |
Notes & Version History
| Note | Similar to the CombinePathAndFile function except in cases where the first argument is a single letter as in examples #1 and #2. |