![]() |
|
#16
|
||||
|
||||
|
Hi Jamal,
Change: .BuiltInDocumentProperties(wdPropertyBytes) / 1024 & "KB" to: Format(.BuiltInDocumentProperties(wdPropertyBytes) / 1024, "#,##0") & "KB"
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#17
|
|||
|
|||
|
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? |
|
#18
|
|||
|
|||
|
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 |
|
#19
|
|||
|
|||
|
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. |
|
#20
|
|||
|
|||
|
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.
|
|
#21
|
|||
|
|||
|
Quote:
best Jamal Last edited by Jamal NUMAN; 11-13-2012 at 01:19 AM. |
|
#22
|
|||
|
|||
|
Hi,
In inserted the following into my normal template: Sub AutoOpen() I am receiving an error message, which is attached. What else should I add? Thanks. |
|
#23
|
||||
|
||||
|
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] |
|
#24
|
|||
|
|||
|
Thanks Paul. Inserting "On Error Resume Next" on the first line solved the problem :-)
|
|
#25
|
|||
|
|||
|
Quote:
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 ------------- |
|
|
|
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 |
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 |