Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #16  
Old 05-05-2011, 02:26 AM
macropod's Avatar
macropod macropod is offline How to have the location (path) of the Word document on the title bar? Windows 7 32bit How to have the location (path) of the Word document on the title bar? Office 2007
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default


Hi Jamal,

Change:
.BuiltInDocumentProperties(wdPropertyBytes) / 1024 & "KB"
to:
Format(.BuiltInDocumentProperties(wdPropertyBytes) / 1024, "#,##0") & "KB"
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #17  
Old 11-12-2012, 12:35 PM
wardw wardw is offline How to have the location (path) of the Word document on the title bar? Windows 7 64bit How to have the location (path) of the Word document on the title bar? Office 2007
Advanced Beginner
 
Join Date: Oct 2012
Posts: 59
wardw is on a distinguished road
Default ActiveWindow.Caption = ActiveDocument.FullName doesn't work for me

I've tried the macro, per below, but my title bar in Word still doesn't display a path:

Option Explicit
__________________
Sub AutoOpen()
'Displays the Document Path in the Title Bar
ActiveWindow.Caption = ActiveDocument.FullName
End Sub

I'm a total newbie to VB, so please bear with me. My Project Explorer window shows:

Normal
Microsoft Word Objects
ThisDocument
Modules
AutoNew

If I "View Code" for ThisDocument and AutoNew they show the same code, but in ThisDocument the Option Explicit line is not there.

Do I have the code in the wrong place?
Reply With Quote
  #18  
Old 11-12-2012, 01:54 PM
Jamal NUMAN Jamal NUMAN is offline How to have the location (path) of the Word document on the title bar? Windows 7 64bit How to have the location (path) of the Word document on the title bar? Office 2010 64bit
Expert
How to have the location (path) of the Word document on the title bar?
 
Join Date: Nov 2010
Posts: 525
Jamal NUMAN is on a distinguished road
Lightbulb

Hi wardw,

The code has originally created by Paul and it works very well.

Please, have a look on the attached screenshot. Note that you need to click on the icon on the quick access bar to have the path typed on the title bar

Best

Jamal
Attached Images
File Type: jpg Clip_401.jpg (89.9 KB, 20 views)
__________________
Jamal NUMAN, Jamal432@gmail.com, P.O.BoX: 731, Ramallah, West Bank.
Reply With Quote
  #19  
Old 11-12-2012, 06:00 PM
wardw wardw is offline How to have the location (path) of the Word document on the title bar? Windows 7 64bit How to have the location (path) of the Word document on the title bar? Office 2007
Advanced Beginner
 
Join Date: Oct 2012
Posts: 59
wardw is on a distinguished road
Default

Thanks, Jamal; I'm using the code you specified, and it's AutoOpen, all right, but the only way I can make it work is by having the VB editor open while the Word document is open, and then running the macro from within VB.

If I just pick another document from Word and open it, a VB error message appears: "Object variable or With block variable not set". When I click OK the document doesn't have its path in the title bar.
Reply With Quote
  #20  
Old 11-12-2012, 06:07 PM
wardw wardw is offline How to have the location (path) of the Word document on the title bar? Windows 7 64bit How to have the location (path) of the Word document on the title bar? Office 2007
Advanced Beginner
 
Join Date: Oct 2012
Posts: 59
wardw is on a distinguished road
Default

Ooooops. All works fine now. I hadn't put an icon on the quick access bar. I've done that, and it's working now. Thanks so much for your help, Jamal.
Reply With Quote
  #21  
Old 11-13-2012, 12:10 AM
Jamal NUMAN Jamal NUMAN is offline How to have the location (path) of the Word document on the title bar? Windows 7 64bit How to have the location (path) of the Word document on the title bar? Office 2010 64bit
Expert
How to have the location (path) of the Word document on the title bar?
 
Join Date: Nov 2010
Posts: 525
Jamal NUMAN is on a distinguished road
Thumbs up

Quote:
Originally Posted by wardw View Post
Ooooops. All works fine now. I hadn't put an icon on the quick access bar. I've done that, and it's working now. Thanks so much for your help, Jamal.
Happy to hear that all worked fine. Indeed, the code was fully developed by Paul. i send him my regards

best

Jamal
__________________
Jamal NUMAN, Jamal432@gmail.com, P.O.BoX: 731, Ramallah, West Bank.

Last edited by Jamal NUMAN; 11-13-2012 at 01:19 AM.
Reply With Quote
  #22  
Old 08-30-2017, 01:49 PM
rekeene rekeene is offline How to have the location (path) of the Word document on the title bar? Windows 7 32bit How to have the location (path) of the Word document on the title bar? Office 2010 32bit
Novice
 
Join Date: Aug 2017
Posts: 2
rekeene is on a distinguished road
Default Runtime error

Hi,

In inserted the following into my normal template:
Sub AutoOpen()
'Displays the Document Path in the Title Bar
ActiveWindow.Caption = ActiveDocument.FullName
End Sub

I am receiving an error message, which is attached. What else should I add? Thanks.
Attached Images
File Type: png Runtime error.PNG (13.3 KB, 19 views)
Reply With Quote
  #23  
Old 08-30-2017, 02:27 PM
macropod's Avatar
macropod macropod is offline How to have the location (path) of the Word document on the title bar? Windows 7 64bit How to have the location (path) of the Word document on the title bar? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You might try opening a document. You could also add:
On Error Resume Next
as the macro's first executable line.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #24  
Old 09-01-2017, 10:17 AM
rekeene rekeene is offline How to have the location (path) of the Word document on the title bar? Windows 7 32bit How to have the location (path) of the Word document on the title bar? Office 2010 32bit
Novice
 
Join Date: Aug 2017
Posts: 2
rekeene is on a distinguished road
Default

Thanks Paul. Inserting "On Error Resume Next" on the first line solved the problem :-)
Reply With Quote
  #25  
Old 09-06-2017, 12:18 PM
Jamal NUMAN Jamal NUMAN is offline How to have the location (path) of the Word document on the title bar? Windows 7 64bit How to have the location (path) of the Word document on the title bar? Office 2010 64bit
Expert
How to have the location (path) of the Word document on the title bar?
 
Join Date: Nov 2010
Posts: 525
Jamal NUMAN is on a distinguished road
Lightbulb

Quote:
Originally Posted by rekeene View Post
Thanks Paul. Inserting "On Error Resume Next" on the first line solved the problem :-)

I tried the same code below in my Word 2016 and it works fine with no issues.

------
Sub AutoOpen()
'Displays the Document Path in the Title Bar
ActiveWindow.Caption = ActiveDocument.FullName
End Sub
-------------
Attached Images
File Type: jpg Clip_354.jpg (196.2 KB, 13 views)
__________________
Jamal NUMAN, Jamal432@gmail.com, P.O.BoX: 731, Ramallah, West Bank.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Hyperlinks from Word to specific location in PDF sukanyae Word 0 02-25-2010 04:08 PM
Show Full File Path in Title Bar paulj Excel 3 02-10-2010 07:18 AM
How to have the location (path) of the Word document on the title bar? Convert word document to JPEG. The word document may contain headerfooters vijayaram Word 1 12-30-2009 08:25 AM
Programmatically get File Path for currently opened WORD document franferns Word 1 11-26-2009 12:36 PM
attaching (relative,logical or virtual) path to template word document wissam Mail Merge 0 08-04-2009 05:09 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:17 AM.


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