Do you mean show all the path, but no drive letter? I am not sure why you would want the path without the drive letter. The syntax for path imcludes the drive. However, tecnically speaking, what is returned by AutoText is, in fact, text, and therefore can be edited. And certainly you could have a macro parse through the returned "file and path", and remove the drive letter, but it seems more work than it is worth. Do you want to remove the : as well? The first "\"?
I want to show all the file path except the "C:\". I would like to create that autotext so that it will be include in the footer of our documents to show internally. Thanks!
The filename field only gives you a full filename with/without the full path. There's no option for displaying the path without the drive details. You would need to use a macro for that.
The following macro displays a message box with the path, no drive letter. Message is just a string, so you could use it further, as needed.
Sub ShowPathNoDrive()
' note this assumes path is NOT UNC
' if UNC then would need more editing
' to pick out just local path on sever
Dim filenamepath As String
Dim pathlength As Integer
' path string
filenamepath = ActiveDocument.FullName
pathlength = Len(filenamepath) - 3 ' 'drive:\"
MsgBox Right(filenamepath, pathlength)
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.