Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Environmental Variable

Status
Not open for further replies.

markt

MIS
Sep 7, 1999
76
GB
Is it possible to set a user defined environmental variable and return the value into WORD?

i.e. set UserEmail=fred@internet.com and then in WORD have this included in the letterhead

I can get Excel to get the system defined variables but can seem to get my userdefined ones in.

Thanks
Mark
 
Consider using the registry rather than environment variables. I think the interface is more consistent between different Windows versions that way. (But I'm not an expert at this - others please bash me if I'm wrong ;-))


Rob
[flowerface]
 
The other way I thought of doing this is by creating a small text file with each variable on a new line. I would then try to get VBA to read each line and set a variable that way. Would that be easier?

Mark
 
That would work just fine - as long as the location of the text file is unambiguous. Let us know if you need any help implementing any of the solutions.


Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top