jtaylerg
asked on
Word 03 - Custom Doc Property - How do you find out if it exists already?
Hi There,
I'm trying to come up with an easy way to distinguish whether or not a user created a document from a firm template or copied it from our old system.
So I decided to add a custom doc property to the new templates.
I need vba code to determine if the custom doc property exists in the active document. If it does, we move on. If it doesn't, they get a message that they're not working in a current system file.
Any ideas?
Thanks! JTG
I'm trying to come up with an easy way to distinguish whether or not a user created a document from a firm template or copied it from our old system.
So I decided to add a custom doc property to the new templates.
I need vba code to determine if the custom doc property exists in the active document. If it does, we move on. If it doesn't, they get a message that they're not working in a current system file.
Any ideas?
Thanks! JTG
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the help. I just rewrote the sub to call the function.
Have a great day!
JTG
Have a great day!
JTG
I don't normally use Functions when a Sub will do. I had intended to write a calling sub, but changed my mind and just wrote the Message box inside the function.
If not HasProperty then
Msgbox "Not current system File"
End If
Thanks for the grade & I've already had a nice day (It's 21:15 here). But have a good one yourself.
If not HasProperty then
Msgbox "Not current system File"
End If
Thanks for the grade & I've already had a nice day (It's 21:15 here). But have a good one yourself.
ASKER
Novice: I'm sorry, I'm not familiar with functions.
I've been writing everything as public and private subs. Can I use a function within a Sub?
For instance, if they click a button that runs "Public Sub FileSave()"
within that sub can I run the function or does it need to call the function?
Thanks again!
JTG