Path in Title Bar?

J

JethroUK

Is there any built-in option to show the path/filename in the title bar (as
opposed to just filename)?

Thanx
 
M

Martin

Graham,

I am using Word 2000.

I can run your statement once a document is open and it works fine but
if I put it into an AutoOpen macro as you suggested then I get the
error :

Object variable or With block variable not set

Debugging the statement I have found that it is ActiveWindow that is
Nothing.

The only time the statement didn't fail was when I opened up the
normal.dot itself to remove the macro.

What have I done wrong please?!

Martin
 
G

Graham Mayor

Hmmm. I am puzzled by this. The code line

ActiveWindow.Caption = ActiveDocument.FullName

has been in my autoopen macro for years - certainly when I was using
Word2000. You should not have to 'open normal.dot' to add or remove a macro,
you can do it from an open document - macros are by default saved in
normal.dot. Can I suggest that you temporarily rename normal.dot to
oldnormal.dot, start Word then tools > macros > AutoOpen > Create and paste
the line of code from here.
Then open a document. Does this still produce the error?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
M

Martin

Hi, Graham,

Thanks for your reply.

You're not the only one to be puzzled! I did as you asked and created
a new normal.dot and the AutoOpen macro worked fine. I then deleted
that template, renamed mine back and tried again creating the AutoOpen
macro in that one. It now works in that one too.

I don't know whether I did something differently or whether Word had
somehow got confused the first time. Anyway, the good news is that it
works fine and more good news is that in the meantime I had created
two custom menu options which run macros to :

1) toggle the caption between ActiveDocument.Name and
ActiveDocument.FullName.
2) copy the caption to the clipboard

neither of which I knew were possible before today! Thank you.

Martin
 
G

Graham Mayor

It should do, though I no longer have Word 97 to check. Try it - if it
doesn't work you'll get an error message.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
J

Jeff

Hi, I am trying this in XP Home with Word from Office XP.

I get no errors when I run the macro "pathintitlebar", but nothing happens.
Samething if I run "AutoOpen" In either case the path does not appear. What
am I doing wrong? I am afraid I do not know much about coding.

Here is what I see in the macro editor:
________________________
Sub pathintitlebar()
'
' pathintitlebar Macro
' Macro created 9/23/2004 by jsm
End Sub
___________________________
Sub AutoOpen()
ActiveWindow.Caption = ActiveDocument.FullName
End Sub
____________________________

Jeff Malka
Outgoing mail is certified Virus Free by AVG
 
G

Graham Mayor

You only need this bit

Sub AutoOpen()
ActiveWindow.Caption = ActiveDocument.FullName
End Sub

The document has to be saved before it has a path to appear in the title
bar.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
J

Jeff

Just for future reference: I tried it in my wife's Word 97 and it works.
Also works in my Word 2000. Thanks.
 

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.

Ask a Question

Top