Equiv of Environ("UserName") in Word 2003

G

Graham Hearn

Hello,

I am altering a system which writes a .doc file from an Access database.
The .doc file is turn the Mail Merge data source for a Word template. Each
user used to run the front end on his or her own PC, but we are now sharing
Server 2003 via Terminal Services.

I have found and used the variable in VB for Access so that each user's .doc
is sent to his or her own My Data Sources folder, which is
Environ("UserName").

However the same variable is not working in VB for Word (!) as per the
following line:

ActiveDocument.OpenDataSource Name:="C:\Documents and Settings\" &
Environ("UserName") & "\My Documents\My Data Sources\brief.doc"

Can you tell me what I should use to designate the UserName instead please?
 

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