The following two Basic macros FILENAME() and FILEPATH() may help. ~~~~~ Option Explicit Option VBASupport 1 ' Enables InStrRev()
' Returns file name including extension. Public Function FILENAME() As String Dim u As String Dim i As Long u = ConvertFromURL( ThisComponent.Url ) i = InStrRev( u, GetPathSeparator() ) FILENAME = Right( u, Len(u) - i ) End Function ' Returns file path excluding trailing separator. Public Function FILEPATH() As String Dim u As String Dim i As Long u = ConvertFromURL( ThisComponent.Url ) i = InStrRev( u, GetPathSeparator() ) FILEPATH = Left( u, i - 1 ) End Function ~~~~~ -rl Am 2012-10-20 um 13:07 schrieb Luuk <[email protected]>: > On 19-10-2012 16:23, Samuele Zampini wrote: >> I solved it with this formula: >> >> =REPLACE(REPLACE(CELL("filename");FIND(".";CELL("filename");1);(LEN(CELL("filename"))-FIND(".";CELL("filename");1)+1);"");1;SEARCH("/[^/]*$"; >> CELL("filename"));"") >> >> I like it! >> > > its a bit too long .... > > i would like CELL("shortfilename") more > > CELL("Filename") should return just the name (without path) > and CELL("path") to return the path > ... -- For unsubscribe instructions e-mail to: [email protected] Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
