Persistent variables in a template?

M

ML

Is it possible to create a variable within a template that will store data
between sessions? I need to store some info for a document that will be
created by the user. I have been using custom properties but these have a
limited length and I need to store longer text.

Is there a way to do this with a variable?
 
C

Charles Kenyon

Document variables certainly can be stored in templates. Have you considered
using AutoText, though?
 
D

Doug Robbins

You can use:

ActiveDocument.Variables("varname").Value = "Some long string"

to store information in a document variable. It can be retrieved using

ActiveDocument.Variables("varname").Value

and displayed in the document by way of a { DOCVARIABLE varname" } field

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 

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