Storing Variables as defaults

M

MarkI

Hello all

I have created a user form to allow the user to position pictures and text
as well as add some text on a publication by publication basis. For the most
part, the values for these variables will stay the same. At the moment, I
initialise the values of the text boxes on the form, by hard coding. But if
the user changes any of the values, I'd like them to become the default next
time the template is used.

Can anybody help?

Thanks
 
E

Ed Bennett

MarkI said:
I have created a user form to allow the user to position pictures and
text as well as add some text on a publication by publication basis.
For the most part, the values for these variables will stay the same.
At the moment, I initialise the values of the text boxes on the form,
by hard coding. But if the user changes any of the values, I'd like
them to become the default next time the template is used.

This isn't really a Publisher-specific issue, it's just general VBA.

You can use the SaveSetting command to save a value in the Registry for your
application.
You then use the GetSetting command to retrieve it again.
 
M

MarkI

Perfect thanks. I did read something about tags is this something I could
consider or do they have a limited lifespan?

Thanks for the help!
 
E

Ed Bennett

MarkI said:
Perfect thanks. I did read something about tags is this something I
could consider or do they have a limited lifespan?

They have a document-based lifespan, and they require an object to which to
attach them. If you remain very strictly in control of the objects in your
document, tags will allow you to save defaults with the template or document
and move it from PC to PC.

GetSetting and SaveSetting use the Registry, which is restricted to the
machine in use.
 
M

Mark I

Ed Bennett said:
They have a document-based lifespan, and they require an object to which
to attach them. If you remain very strictly in control of the objects in
your document, tags will allow you to save defaults with the template or
document and move it from PC to PC.

GetSetting and SaveSetting use the Registry, which is restricted to the
machine in use.
Many thanks Ed for the fantastic help. I'll consider both these options.

Regards

Mark
 

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