Document Variables or Custom Document Propertes

J

jo

I am migrating a VBA Word Template (Office XP) tp a Word 2007 add-in.
I have used document variables extensively in the template. Should I
continue using them with Office 2007 or would custom document
properties be better since I can get at them in the open xml format?

Are there any limitations on custom document properties that would
prevent me from switching from document variables to custom document
properties?

What are the pros & cons?
 
J

Jezebel

Document properties are accessible to the user through File > Properties.
Variables are accessible only via VBA. Whether that's a pro or a con depends
on what they are for.

Properties need slightly more code, too. With a variable you can use the
same code to add and to change the value; with a property, adding and
setting are different, and you also have to worry about data type. Eg, if
you add a property of type date and subsequently want to change the value,
you have to acknowledge the possibility that the user has displayed the
Properties dialog and changed the data type. (Not at all hard to deal with,
but the problem isn't there at all with variables.)
 
P

Peter Jamieson

Are there any limitations on custom document properties that would
prevent me from switching from document variables to custom document
properties?

As far as I know strings in Document properties are limited to 255
characters, but document variables let you store around 65536 characters.

Peter Jamieson
 

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