As with any OS X window, if you CMD-click on the window title, you'll
see a dropdown with the document path. You can select the folder from
the dropdown.
I also use a macro to toggle the full path in the window header:
Public Sub CaptionToggle()
Dim docMyDoc As Document
Set docMyDoc = ActiveDocument
With ActiveWindow
.Caption = Iif(.Caption = docMyDoc.FullName, _
docMyDoc.Name, docMyDoc.Fullname)
End With
End Sub
Just to prove to you all that I was paying attention, I think John may have
had a keybounce in ".Caption = Iif(.Caption". I think that should be
".Caption = If(.Caption"
(Only one "I" in "if"...)
Cheers
Actually, I think I was wanting a macro like that recently, but too lazy to
put any effort into asking about one. Thanks, JE.
{Blush} Just to prove to you all that I don't know whatinhell I'm talking
about, I have NEVER seen the IIF function before in VBA
John, whereinhell did you find THAT one ??? Yeah, I know, in the VBA Help,
right? Awww shaddap!!!
* * * * *
IIf Function
Returns one of two parts, depending on the evaluation of an expression.
Syntax
IIf(expr, truepart, falsepart)
The IIf function syntax has these named arguments:
Part Description
expr Required. Expression you want to evaluate.
truepart Required. Value or expression returned if expr is True.
falsepart Required. Value or expression returned if expr is False.
Remarks
IIf always evaluates both truepart and falsepart, even though it returns
only one of them. Because of this, you should watch for undesirable side
effects. For example, if evaluating falsepart results in a division by zero
error, an error occurs even if expr is True.
* * * * *
The code is fine the way he typed it
Just to prove to you all that I was paying attention, I think John may have
had a keybounce in ".Caption = Iif(.Caption". I think that should be
".Caption = If(.Caption"
Actually, Iif() is remarkably well buried in VBA Help. I can only find
links to it from the Switch() and Choose() methods.
I'm surprised it isn't in the See Also for Select Case and If...Then.
And it should at least be mentioned in the "Control Flow Keyword
Summary" topic
Of course it comes up if you search for it directly.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.