Modify project properties company name in VBA

R

robgr

Hi,

I'm having a hard time determining how to modify the company field in the
project properties summary tab through VBA. I'm trying to create a macro that
would modify this field if there were more than 16 characters.

Any help is appreciated.
 
R

robgr

I found it. Perhaps someone might benefit from this.

Sub propertiesnamechange()

sngChar = Len(ActiveProject.company)
If sngChar > 16 Then
ActiveProject.company = "short text"
End If

End Sub
 
J

Jan De Messemaeker

Hi,

This is funny.
The company propery of the project object is not documented but to my
astonishment it works.
The version that is documented (and can be used for other properties) is
Activeproject.builtindocumentproperties ("Company")
HTH
 
R

robgr

You're right. It's not documented. For someone like me with very little
experience, I was relying on the object browser and auto list members which
of course did not help me in this situation.
 

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