G
Graham Mayor
I have used macros similar to the following to insert (in this instance) the
path at the foot of a document. However testing this in Word 2007 has thrown
up an anomaly in that the check for whether the document is saved is
completely ignored inevitably causing an error at the line pPathname= if the
document has not already been saved.
This always worked in Word 2003, however on testing again in Word 2003 (my
PC currently has both Word 2003 and 2007 installed in parallel) it no longer
worked there either.
Following a reboot, it worked again in 2003, but not in 2007, and then on
closing 2007 and reopening 2003 it no longer works there. Reboot and open
2007 without first opening 2003 and it still doesn't work
Initially I thought that the presence of both versions was the problem, but
my laptop only has 2007 and it doesn't work there either. Any ideas?
I am trying to like 2007 ..... honest .... but it seems to throw up one
problem after another.
On an entirely different note my laptop's Word 2007 has an AddIns tab on the
Ribbon, that of my desktop doesn't. My desktop has Acrobat 8.1 instead. I
guess that may be getting in the way, in the inimitable manner Adobe has of
screwing with Word ?
Sub InsrtPath()
Dim pPathname As String
Dim pFoldername As String
With ActiveDocument
If Not .Saved Then
.Save
End If
pPathname = Left$(.FullName, (Len(.FullName) - Len(.Name) - 1))
pFoldername = Right$(pPathname, (Len(pPathname) -
InStrRev(pPathname, "\")))
End With
Selection.TypeText pPathname
End Sub
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
path at the foot of a document. However testing this in Word 2007 has thrown
up an anomaly in that the check for whether the document is saved is
completely ignored inevitably causing an error at the line pPathname= if the
document has not already been saved.
This always worked in Word 2003, however on testing again in Word 2003 (my
PC currently has both Word 2003 and 2007 installed in parallel) it no longer
worked there either.
Following a reboot, it worked again in 2003, but not in 2007, and then on
closing 2007 and reopening 2003 it no longer works there. Reboot and open
2007 without first opening 2003 and it still doesn't work
Initially I thought that the presence of both versions was the problem, but
my laptop only has 2007 and it doesn't work there either. Any ideas?
I am trying to like 2007 ..... honest .... but it seems to throw up one
problem after another.
On an entirely different note my laptop's Word 2007 has an AddIns tab on the
Ribbon, that of my desktop doesn't. My desktop has Acrobat 8.1 instead. I
guess that may be getting in the way, in the inimitable manner Adobe has of
screwing with Word ?
Sub InsrtPath()
Dim pPathname As String
Dim pFoldername As String
With ActiveDocument
If Not .Saved Then
.Save
End If
pPathname = Left$(.FullName, (Len(.FullName) - Len(.Name) - 1))
pFoldername = Right$(pPathname, (Len(pPathname) -
InStrRev(pPathname, "\")))
End With
Selection.TypeText pPathname
End Sub
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>