Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2012-03-13
5
Medium Priority
?
350 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 2000 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

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

719 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