I need help reading/writing to the registry

P

Pat Adams

Hello.
In Word 2002, I have a macro that should store a person's name, fax number and telephone extension in the registry and another one that should be able to read that registry information into a userform whenever they create new correspondence.

I can't seem to decipher the syntax for doing it.

Could someone provide me with a code sample?

TIA,
Pat
 
J

Jonathan West

Hi Pat,

The GetSetting and SaveSetting commands are designed for this sort of thing.
There are code samples in the VBA Help file

--
Regards
Jonathan West - Word MVP
http://www.multilinker.com
Please reply to the newsgroup

Hello.
In Word 2002, I have a macro that should store a person's name, fax number
and telephone extension in the registry and another one that should be able
to read that registry information into a userform whenever they create new
correspondence.

I can't seem to decipher the syntax for doing it.

Could someone provide me with a code sample?

TIA,
Pat
 
P

Pat Adams

Thanks, Jonathan. It was easier than I thought it should be, but just in
case someone is interested, here is more details.

I designed a fax cover sheet and used userforms to capture not only who the
fax was going to, but who it was from. The company has subsidiaries, so I
needed to set up defaults by user that would write the person's name,
company, phone and fax number and automatically display that information
whenever they started a new fax cover sheet. I also needed to allow them to
change the defaults whenever they needed. My save settings script was like
this:

SaveSettings "MS Word", "Private Templates", "FromName",
FormName.txtFieldName

I read the information with in the initialize event for the userform,

FormName.TxtFieldName = GetSettings("MS Word", "Private Templates",
"FromName")

Thanks,
Pat
 

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