Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2005

Tip: Looking for answers? Try searching our database.

Persistent variables in a template?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ML - 26 Feb 2005 18:22 GMT
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?
Charles Kenyon - 26 Feb 2005 22:59 GMT
Document variables certainly can be stored in templates. Have you considered
using AutoText, though?
Signature


Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

> 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?
Doug Robbins - 26 Feb 2005 23:07 GMT
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

Signature

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

> 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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.