Solved

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

Posted on 2012-03-13
5
301 Views
Last Modified: 2012-03-14
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 ?
0
Comment
Question by:Itomicltd
  • 3
  • 2
5 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 37714510
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
 

Author Comment

by:Itomicltd
ID: 37716524
Can you advise how she would do this. Word 2007.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 37717948
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
 

Author Comment

by:Itomicltd
ID: 37719638
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
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 37720244
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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now