Save document via VBA with username??

D

Don H

I made a survey sheet that I plan on mailing to people and
I want it to automatically save to a network share. I have
that working fine, but I need help with the naming. I
would like it to give the username and then the document
name that I specified. Here is the code..

ActiveDocument.SaveAs "\\mtnies01\open\survey\survey
results.doc"

If I put %username% in from of the survey results.dox it
shows up as %username%Survey Results.doc.

Can I easily make it so I can get the username in there?

Thanks in advance!

Don
 
C

Chad DeMeyer

ActiveDocument.SaveAs "\\mtnies01\open\survey\" & Environ("USERNAME") & "
survey results.doc"

Regards,
Chad
 
Top