Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-18-2020, 12:02 AM
dita dita is offline Copy working folder name into Title properties Windows XP Copy working folder name into Title properties Office 2010 64bit
Advanced Beginner
Copy working folder name into Title properties
 
Join Date: Apr 2018
Posts: 34
dita is on a distinguished road
Default 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!
Reply With Quote
  #2  
Old 05-18-2020, 02:37 AM
macropod's Avatar
macropod macropod is online now Copy working folder name into Title properties Windows 7 64bit Copy working folder name into Title properties Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 20,358
macropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant future
Default

How much of the folder's path?
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 05-18-2020, 03:04 AM
dita dita is offline Copy working folder name into Title properties Windows XP Copy working folder name into Title properties Office 2010 64bit
Advanced Beginner
Copy working folder name into Title properties
 
Join Date: Apr 2018
Posts: 34
dita is on a distinguished road
Default

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.
Reply With Quote
  #4  
Old 05-18-2020, 04:48 AM
macropod's Avatar
macropod macropod is online now Copy working folder name into Title properties Windows 7 64bit Copy working folder name into Title properties Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 20,358
macropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant future
Default

Try:
Code:
Sub Demo()
With ActiveDocument
  If .Path <> "" Then .BuiltInDocumentProperties("Title") = Right(.Path, Len(.Path) - InStrRev(.Path, "\"))
End With
End Sub
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #5  
Old 05-18-2020, 05:15 AM
dita dita is offline Copy working folder name into Title properties Windows XP Copy working folder name into Title properties Office 2010 64bit
Advanced Beginner
Copy working folder name into Title properties
 
Join Date: Apr 2018
Posts: 34
dita is on a distinguished road
Default

It works Thanks a million!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy working folder name into Title properties 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

Other Forums: Access Forums - Senior Forums

All times are GMT -7. The time now is 01:50 AM.


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