setting folder properties to input footer into saved doc with location of folder.

A user in our office wants to setup a system so that when she saves a document in a particlular folder it puts the file location into the footer of that document. How can i accomplish this ?
ItomicltdAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GrahamSkanRetiredCommented:
If she inserts a FileName field that has a \p switch, the whole path, including the file name will display. Otherwise some VBA code will be needed.

Please mention the Word version if any clarification is required.
0
ItomicltdAuthor Commented:
Can you advise how she would do this. Word 2007.
0
GrahamSkanRetiredCommented:
Select the position in the footer-

Insert tab, text group, Quick Parts dropdown, Field... item to open the Field dialogue.

Select 'FileName' from the list, tick the 'Add path to filename' box and click on OK.

Note that if the document is Saved As later, the field will need to be updated to show the latest setting. The simplest way of doing that is to select the footer (including the field) and press F9.

There is also an Option in the Options Display item to 'Update fields before printing.'
0
ItomicltdAuthor Commented:
The user wants this to automatically happen when she saves into a particular location, so the footer is automated upon save. I'm not sure if this is actually possible !!!!
0
GrahamSkanRetiredCommented:
It'll have to be VBA, then. Put this code in a code module of the Normal template:
Sub FileSave()
    If ActiveDocument.Path = "" Then
        FileSaveAs
    Else
        ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.Text = ActiveDocument.Path
    End If
End Sub

Sub FileSaveAs()
    Dim dlg As Dialog
    Dim strFileName As String
    Dim strPathParts() As String
    Dim strPath As String
    Dim i As Integer
    
    Set dlg = Dialogs(wdDialogFileSaveAs)
    With dlg
        If .Display Then
            strFileName = dlg.Name
            strPathParts = Split(strFileName, "\")
            i = UBound(strPathParts)
            If i = 0 Then
                strPath = Application.Options.DefaultFilePath(wdDocumentsPath)
            Else
                ReDim Preserve strPathParts(i - 1)
                strPath = Join(strPathParts, "\")
            End If
            ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.Text = strPath
           .Execute
        End If
    End With
End Sub

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Applications

From novice to tech pro — start learning today.