Private Sub Form_Load() Dim strPath As String strPath = "\\FSASBA113\stsa\Pocket_PC My Documents\" If Mid(strPath, Len(strPath), 1) = "\" Then strPath = Mid(strPath, 1, Len(strPath) - 2) End If strPath = Right(strPath, Len(strPath) - InStrRev(strPath, "\")) Me.Caption = "N:\" & strPath End Sub
'InStrRev for vb4-vb5 Public Function InStrRev(StringCheck As String, StringMatch As String, _ Optional Start As Long = -1, Optional Compare As _ VbCompareMethod = vbBinaryCompare) As Long Dim i As Long If Compare = vbTextCompare Then StringCheck = LCase(StringCheck) StringMatch = LCase(StringMatch) End If If Start > -1 And Start > 0 Then StringCheck = Left(StringCheck, Start) For i = Len(StringCheck) To 1 Step -1 If Mid(StringCheck, i, Len(StringMatch)) = StringMatch Then Exit For End If Next InStrRev = i End Function
Public Function Split(ByVal TextToSplit As String, Optional Delimiter As String = " ") As Variant
If TextToSplit = "" Then Exit Function
Dim TempStr As String, tempArr() As String Dim X As Long
On Error Resume Next
If Delimiter <> "" Then Do X = InStr(TextToSplit, Delimiter) If X <> 0 Then TempStr = Left(TextToSplit, X - 1) TextToSplit = Right(TextToSplit, Len(TextToSplit) - X + 1 - Len(Delimiter))
ReDim Preserve tempArr(UBound(tempArr) + 1) If Err Then ReDim tempArr(0): Err = 0 tempArr(UBound(tempArr)) = TempStr
End If Loop While X <> 0 End If
If TextToSplit <> "" Then
ReDim Preserve tempArr(UBound(tempArr) + 1) If Err Then ReDim tempArr(0) tempArr(UBound(tempArr)) = TextToSplit
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.