Filename & Path with Usename

E

Es

I'm working on a Network with a username. I want to place the filename and
path with my user name in the footer. It seems if it is only the filename
and path that I can place in the footer ( I want to combine the two fields).
Normally it looks like K:\MSOFFICE\WORD\Name of File. It should looks like
K:\EBE\MSOFFICE\WORD\Name of File. I’m given Office course for ± 600 user.
I want to train the users to add their user names to the file name, because
we do not know who type the documents. I will appreciate it if you can help
me. Thanks
 
G

Graham Mayor

You can use a macro to add the data to the footer eg

Sub InsertfNameAndPath()
Dim pPathname As String
Dim sUsername As String
sUsername = Application.UserName

With ActiveDocument
If Len(.Path) = 0 Then
.Save
End If
If Right(.Name, 1) = "x" Then
pPathname = Left$(.FullName, (Len(.FullName) - 5))
Else
pPathname = Left$(.FullName, (Len(.FullName) - 4))
End If
.ActiveWindow.View.SeekView = wdSeekCurrentPageFooter
With Selection
.TypeText pPathname
.TypeText " - "
.TypeText sUsername
End With
.ActiveWindow.View.SeekView = wdSeekMainDocument
End With
End Sub

http://www.gmayor.com/installing_macro.htm
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
M

macropod

Hi Es,

If you set your system up with an appropriate set of Word templates, then your users won't have to remember to add the filename
fields. Adding the user name to the path violates the purpose of the filename field - if you need that, then the path should have
it.

Alternatively, you could use both a filename field to tell you where the document is located and a separate Author, Username or
UserInitials field to indicate the author/user.

Cheers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top