Attribute VB_Name = "PubFunctions" Public Function Extract(strIn) As String Dim x As Integer, y As Integer, strC As String x = 0 Do x = x + 1 strC = Mid(strIn, x, 1) Loop Until (x = Len(strIn)) Or (strC = Chr(34)) y = x Do y = y + 1 strC = Mid(strIn, y, 1) Loop Until (y = Len(strIn)) Or (strC = Chr(34)) If x < Len(strIn) Then Extract = Mid(strIn, x + 1, y - x - 1) Else Extract = "" End If End Function Public Function UniquePortion(strIn As String) As String Dim l As Integer, i As Integer Dim n$, f$, t$ If Len(strIn) < Len(strDocFileName) Then l = Len(strIn) Else l = Len(strDocFileName) End If Do i = i + 1 n$ = Mid$(strIn, i, 1) f$ = Mid$(strDocFileName, i, 1) If n$ <> f$ Then If i = 1 Then t$ = strIn Exit Do Else t$ = "..\" & Right$(strIn, Len(strIn) - (i - 1)) Exit Do End If End If Loop Until i = l If t$ = "" Then t$ = ".." End If UniquePortion = t$ End Function Public Function PathPortion(strIn As String) As String Dim i As Integer i = Len(strIn) Do While (Mid$(strIn, i, 1) <> "\") And (i > 0) i = i - 1 Loop If i > 0 Then PathPortion = Left$(strIn, i) Else PathPortion = "" End If End Function