#1
|
|||
|
|||
Copy working folder name into Title properties
Hello! I hope this is easy to do. I need a macro that reads the folder name where I am working and then copy it into the Title Properties of the document. Is it possible? Thanks! |
#2
|
||||
|
||||
How much of the folder's path?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
The working folder is at this level:
C:\Users\user\Desktop\TEST\folder_name and "folder_name" is what I want to add to the title properties. Note that folderīs path may vary in some cases but itīs not use to be too large. |
#4
|
||||
|
||||
Try:
Code:
Sub Demo() With ActiveDocument If .Path <> "" Then .BuiltInDocumentProperties("Title") = Right(.Path, Len(.Path) - InStrRev(.Path, "\")) End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
It works Thanks a million!
|
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Copy Properties | Sark | Word VBA | 6 | 03-26-2018 03:25 AM |
Set Default Filename: Title Composed of Two Document Properties | mike_302 | Word VBA | 1 | 01-18-2018 04:36 AM |
Title versus Titre in file properties... | Gael | Word | 4 | 08-28-2015 07:59 AM |
How to constantly and automatically copy the contacts from a shared folder to my private folder? | Paulo | Outlook | 0 | 08-16-2015 12:06 PM |
Copy/Paste with all Properties | mohsen.amiri | Word | 2 | 02-23-2015 08:55 PM |