Save As UserName

L

Lee

Hi. Thanks for your reply, however, I'm not sure exactly
what you are saying. I understand that the username on
your example is "administrator" but how would I get that
by using code? I'm new to this VBA stuff...

The normal template is saved in each staff members
personal drive (P:\). The personal drives are named
\\alchemy\private\(username) but I am unsure how to get
that username...

I appreciate your help.. Thanks
-----Original Message-----
There are some very involved ways to derive the username.
However, the easiest way is to parse it from where the
normal template is stored. The following will give you
the bona fide username, not something that was a shortcut
in Word itself (unless the normal template was re- directed
to a non-default folder).

strPath = Application.NormalTemplate.Path

So, on my computer, this is what it provides:

C:\Documents and Settings\Administrator\Application
Data\Microsoft\Templates

So, you can parse what's between documents and settings\
and \applcation data.

Hope this helps.

dz
-
.
..
 
H

Helmut Weber

Hi,
I don't know exactly, what the problem is,
but can't see a simpler way then this one:
Msgbox Environ$("Username")
 

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