Including Windows User Name in Macro?

P

Paul Moloney

I have a macro which at the moment uses a hardcoded value for
a particular directory:

WorkingDir = "C:\Documents and Settings\pmoloney\Desktop\Acrobat\in\"

I'd like to change this so that it uses the Acrobat\in directory on the
current user's desktop; that is:

WorkingDir = "C:\Documents and Settings\{current_user}\Desktop\Acrobat\in\"

How is this done in Word VBA?

Thanks,

P.
 
D

Doug Robbins - Word MVP

Hi Paul,

See the article “How to get the username of the current user” at:

http://word.mvps.org/FAQs/MacrosVBA/GetCurUserName.htm


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

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