Public Function GetFileNameNoExt(SwxModel As Object) As String ' aus dem übergebenen modell (=SwxModel) wird der Dateiname ohne Extension gefiltert ' wenn das Modell noch nicht gespeichert wurde, wird ein 0-String zurückgegeben ' by Andreas Müller; 5503 Schafisheim; Tel. +41 (0)62 891 19 63 Dim strDateipfad As String Dim vDummy As Variant GetFileNameNoExt = "" strDateipfad = SwxModel.GetPathName() If strDateipfad = "" Then Exit Function 'das Modell wurde noch nicht gespeichert Do vDummy = InStr(strDateipfad, "\") strDateipfad = Right(strDateipfad, Len(strDateipfad) - vDummy) Loop While vDummy <> 0 If UCase(Right(strDateipfad, 7)) = ".SLDPRT" Or UCase(Right(strDateipfad, 7)) = ".SLDASM" Then GetFileNameNoExt = Left(strDateipfad, Len(strDateipfad) - 7) Else GetFileNameNoExt = strDateipfad End If End Function