Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-20-2015, 02:28 PM
ruggb ruggb is offline use full path for filename Windows 7 use full path for filename Office 2010 (Version 14.0)
Novice
use full path for filename
 
Join Date: Aug 2010
Posts: 28
ruggb is on a distinguished road
Default use full path for filename

Is there an option to show the full path at the top of the Word 2013 window instead of just the filename? If so where can I find it?
Reply With Quote
  #2  
Old 08-21-2015, 05:10 AM
gmayor's Avatar
gmayor gmayor is offline use full path for filename Windows 7 64bit use full path for filename Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You can do it with a macro (or macros), and it helps to move the QAT (Quick Access Toolbar) below the ribbon, to provide more space.

The following is what I use in my systems. You may not need all the options, but you can delete those you don't. Insert a new module in the normal template, call it (say) modAutoMacros and add the following macro code.
http://www.gmayor.com/installing_macro.htm

Because of the availability of very long filenames, the path length may have to be curtailed to fit the available space. I have it set at 120 characters. You may need to change that.

Code:
Option Explicit
Sub AutoOpen()
    On Error Resume Next
    With ActiveWindow.View
        If Err.Number = 4248 Then Exit Sub
        .Type = wdPrintView
        .Zoom = 100
        .TableGridlines = True
    End With
    ActiveWindow.ActivePane.View.ShowAll = False
    ActiveWindow.ActivePane.View.ShowFieldCodes = False
    If ActiveDocument.Bookmarks.Exists("OpenAt") = True Then
        ActiveDocument.Bookmarks("OpenAt").Select
    End If
    InsertDocTitle
lbl_Exit:
    Exit Sub
End Sub

Sub AutoNew()
    With ActiveWindow.View
        .Type = wdPrintView
        .TableGridlines = True
        .Zoom = 100
        .ShowFieldCodes = False
        .ShowAll = False
    End With
    ActiveWindow.ActivePane.View.ShowAll = False
lbl_Exit:
    Exit Sub
End Sub


Sub InsertDocTitle()
' Changes window title to include path with filename
Dim NameArray As Variant
Dim NameStringL As String
Dim NameStringR As String
Dim Count As Long
Const maxLen = 120        ' set this value to fit your window width
    ' (avoid error if no active window)
    If Windows.Count > 0 Then
        NameStringL = ActiveDocument.FullName
        If Len(NameStringL) > maxLen Then
            ' separate the folder names
            NameArray = Split(NameStringL, "\")
            ' check the folder depth
            Count = UBound(NameArray)
            If Count > 3 Then
                NameStringL = NameArray(0) & "\...\"
                NameStringR = NameArray(Count)
                Count = Count - 1

                ' continue adding folders to the left of the string
                ' until you run out of folders or one won't fit
                Do While (Count > 0) And _
                   (Len(NameStringL) + Len(NameStringR) + _
                    Len(NameArray(Count)) < maxLen)
                    NameStringR = NameArray(Count) & "\" _
                                  & NameStringR
                    Count = Count - 1
                Loop

                NameStringL = NameStringL & NameStringR
            End If
        End If

        ' Change the window's caption
        ActiveWindow.Caption = NameStringL
    End If
lbl_Exit:
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
use full path for filename how to determine the full path of the template from which a document was created? XmisterIS Word VBA 4 08-28-2024 03:32 PM
use full path for filename How to: Have two templates cross-reference each other independent of filename path HighSierra Word 6 05-06-2015 07:04 PM
use full path for filename Showing full path name in title bar GeneH Word 3 05-07-2014 01:44 PM
use full path for filename Display Full File Path Name of Document in Title bar MS-Word 2010 Carlos06x Word 1 10-12-2011 10:39 AM
Show Full File Path in Title Bar paulj Excel 3 02-10-2010 07:18 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:41 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft