One possibility is to use a { USERNAME } field, which inserts the name of
the user as specified in the User info. for /Word/.
If you really need the "user name" that is set up in the user's environment
(i.e. the one that is displayed if you use a SET command in aDOS/CMD box),
there is no built-in /Word/ field that can do it, and whether or not you can
get the value as a /merge/ field depends on what your data source is - e.g.,
you /might/ be able to get it from an Access database by using an
environ('username') function call in an Access query, but even that depends
on whether or not Access is operating in "sandbox mode", which is to do with
security.
You could also probably use a bit of Word VBA (and the Environ("username")
function call) to insert the required value, oryou might be able to use a
Word Auto macro to set up the value of a Word document variable or property
that you could insert using a { DOCVARIABLE } or { DOCPROPERTY } field.
So it's not straightforward, but maybe that will give you some options with
which you can experiment.
Peter Jamieson
> Hi
>
[quoted text clipped - 3 lines]
>
> Jo
Gert Raes - 09 Aug 2007 16:14 GMT
In addition to this post, the next question :
I use the wordfield "username" in a document.
When I use that field in an If-Then-Else Statement, the result is always the
not true - value.
Anyone an idea ?
> One possibility is to use a { USERNAME } field, which inserts the name of
> the user as specified in the User info. for /Word/.
[quoted text clipped - 25 lines]
> >
> > Jo
Peter Jamieson - 09 Aug 2007 18:24 GMT
If you have the username field set to say "Gert Raes" and you use
{ IF { USERNAME } = "Gert Raes" "match" "no match" }
you should see "match.
If you have the username field set to "Gert" and you have
{ IF { USERNAME } = "Gert "match" "no match" }
then you should see "match", unless you also have a bookmark called "Gert"
that is set to something other than "Gert". In that case you might see "no
match". In that case, to ensure (in almost every case) that you see "match,
put quotes around the USERNAME field
{ IF "{ USERNAME }" = "Gert "match" "no match" }
The user name needs to match whatever you are comparing it with /exactly/,
otherwise you will get "no match". e.g. if capitalisation can vary, use
{ IF "{ USERNAME \*Upper } = "GERT "match" "no match" }
If none of that explains what you see, please spell out what your fields
actually contain.
Peter Jamieson
> In addition to this post, the next question :
>
[quoted text clipped - 45 lines]
>> >
>> > Jo
Doug Robbins - Word MVP - 09 Aug 2007 20:36 GMT
Peter was the omission of the closing quote after "Gert or "GERT an
oversight or a bit of shorthand?

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> If you have the username field set to say "Gert Raes" and you use
>
[quoted text clipped - 74 lines]
>>> >
>>> > Jo
Peter Jamieson - 09 Aug 2007 21:29 GMT
Doug...
It was a mistake...
Peter
> Peter was the omission of the closing quote after "Gert or "GERT an
> oversight or a bit of shorthand?
[quoted text clipped - 78 lines]
>>>> >
>>>> > Jo
Peter Jamieson - 09 Aug 2007 21:43 GMT
> It was a mistake...
i.e. a couple of mistakes by me - the two relevant examples should be
{ IF { USERNAME } = "Gert" "match" "no match" }
and
{ IF "{ USERNAME \*Upper }" = "GERT" "match" "no match" }
Peter Jamieson
> Doug...
>
[quoted text clipped - 84 lines]
>>>>> >
>>>>> > Jo