K
Karen Clark
Here's my existing code, which places the
FolderName\FileName (without the entire path, and without
the .doc file extension) at the end of the document in 7
pt. font, and then returns the cursor to it's original
place in the document:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub TruncPath()
Dim strFile As String
Dim strPath As String
Dim intLen As Integer
Dim intNumSlash As Integer
Dim strShortPath As String
Dim strFinal As String
Dim rngPlaceHolder As Range
strFile = Left(ActiveDocument.Name, Len
(ActiveDocument.Name) - 4)
strPath = ActiveDocument.Path
intLen = Len(strPath)
intNumSlash = InStrRev(strPath, "\")
strShortPath = Right(strPath, intLen - intNumSlash)
strFinal = strShortPath & "\" & strFile
Set rngPlaceHolder = Selection.Range
Selection.EndKey Unit:=wdStory
Selection.Font.Size = 7
Selection.TypeText Chr(13) & strFinal & Chr(13)
rngPlaceHolder.Select
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Can someone please help me change the code so it places
the same information in the footer on the last page of the
document (instead of at the end of the document)?
Thank you so much for your help.
Karen
FolderName\FileName (without the entire path, and without
the .doc file extension) at the end of the document in 7
pt. font, and then returns the cursor to it's original
place in the document:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub TruncPath()
Dim strFile As String
Dim strPath As String
Dim intLen As Integer
Dim intNumSlash As Integer
Dim strShortPath As String
Dim strFinal As String
Dim rngPlaceHolder As Range
strFile = Left(ActiveDocument.Name, Len
(ActiveDocument.Name) - 4)
strPath = ActiveDocument.Path
intLen = Len(strPath)
intNumSlash = InStrRev(strPath, "\")
strShortPath = Right(strPath, intLen - intNumSlash)
strFinal = strShortPath & "\" & strFile
Set rngPlaceHolder = Selection.Range
Selection.EndKey Unit:=wdStory
Selection.Font.Size = 7
Selection.TypeText Chr(13) & strFinal & Chr(13)
rngPlaceHolder.Select
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Can someone please help me change the code so it places
the same information in the footer on the last page of the
document (instead of at the end of the document)?
Thank you so much for your help.
Karen