get file property

J

Joy

I have a vba function to get file property, but in that function, it only
gets the activeproject's file property, right now, I wish to get a project
file's property. the file may or may not open, and I only know it is full
path in my computer.
like C:\...\file.mpp

is it possible to do so??how can i modify my codes to let it check this kind
of file's property??


Dim curproj As MSProject.Project
Set curproj = Application.ActiveProject
Dim prop As Object

Dim result As String


Set prop = curproj.CustomDocumentProperties.Item(PropName)
result = prop.value
 
R

Rod Gill

You have to open the project to read the property. You can read from a .mpp
file using oledb, but that feature is no longer available in 2007.

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:
http://www.projectvbabook.com
 

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