saving variables to normal.dot

L

Lucas Karpiuk

i've got users' startup directory set to a shared network location that is
read only. i'd like to be able to save some local preferences/info for each
user - is it possible to do this to the normal.dot file, or is there a better
method available?

thanks in advance
 
J

Jonathan West

Lucas Karpiuk said:
i've got users' startup directory set to a shared network location that is
read only.

Not a good idea. What happen's if the server breaks or the network router
goes down. What do you do with users who have laptops? Do you have other
network-dependent apps whose performance may be adversely affected by the
extra network traffic you are needlessly generating?
i'd like to be able to save some local preferences/info for each
user - is it possible to do this to the normal.dot file, or is there a
better
method available?

It depends entirely on what you are wanting to store. You can use any of the
following

- the registry, accessed using GetSetting and SaveSetting commands

- an ini file, accessed using the System.PrivateProfileString property or
the INI class module by Karl Peterson (available from
http://vb.mvps.org/samples/)

- A plain text file, accessed using the open statement and the Input and
Print commands

- An autotext entry in normal.dot or another template

- A custom document property in normal.dot, or another document or template

- A document variable in normal.dot, or another document or template

- An XML file stored somewhere and accessed using the MSXML library.

There are probably other options I haven't mentioned, but this should give
you an idea of what is available. Which one of these is best for you depends
on circumstances. I have used all of these on different occasions depending
on what i was trying to achieve.
 
L

Lucas Karpiuk

thank you for your response, Jonathan - would you or someone be willing to
provide a basic example of how to store a document variable to normal.dot?
 
J

Jezebel

With NormalTemplate.OpenAsDocument
.Variables("MyVar") = "XXX"
.Close SaveChanges:=True
End With
 

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