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
>
>>-----Original Message-----
>>I have a template add-in which I need to save with a
>>username. The template automatically counts what
>templates
>>users access.
>>
>>The code I have is:
>>'<----------------------Start of Module Code-------------
-
>-
>>------------->
>>Option Explicit
>>
>>Public gccTemplateUsageCounter As clsCounter
>>
>>Public Sub AutoExec()
>>Const cCounterFileFullPath As String
>>= "M:\TECHNOLOGY\TemplateUsage\CountUsage\count_usage.cnt
"
>>
>>' Instantiate class to perform template usage counting
>> Set gccTemplateUsageCounter = New clsCounter
>>
>>' Hook up event handler to that we can catch application
>>level events
>> Set gccTemplateUsageCounter.appWord =
Word.Application
>>
>>' Log the existing counter file (if any)
>> gccTemplateUsageCounter.Initialise
>cCounterFileFullPath
>>End Sub
>>
>>(There is a lot of class modules code with this as well -

>>let me know if you need to view that).
>>
>>The Line:
>>Const cCounterFileFullPath As String
>>= "M:\TECHNOLOGY\TemplateUsage\CountUsage\count_usage.cnt
"
>>is where I need to put the username, e.g.
>>\CountUsage\username_count_usage.cnt
>>
>>Any ideas? Do you need to see the full code? I am
>>running Word 2002. Thanks in advance.
>>.
>>
>.
>
.

Re: Save As UserName by Helmut

Helmut
Fri Sep 24 04:07:15 CDT 2004

Hi,
I don't know exactly, what the problem is,
but can't see a simpler way then this one:
Msgbox Environ$("Username")
---
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000