Solved

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

Posted on 2012-03-13
5
343 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

734 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