Reply
 
Thread Tools Display Modes
  #1   Report Post  
Jo Davis
 
Posts: n/a
Default User Merge Field

Hi

I am trying to create a merge document, i want to insert a merge field of
the user that is logged onto the computer and using the merge document at
that time, can this be done???

Jo
  #2   Report Post  
Peter Jamieson
 
Posts: n/a
Default

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

"Jo Davis" wrote in message
...
Hi

I am trying to create a merge document, i want to insert a merge field of
the user that is logged onto the computer and using the merge document at
that time, can this be done???

Jo



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Gert Raes Gert Raes is offline
external usenet poster
 
Posts: 1
Default User Merge Field

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 ?

"Peter Jamieson" wrote:

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

"Jo Davis" wrote in message
...
Hi

I am trying to create a merge document, i want to insert a merge field of
the user that is logged onto the computer and using the merge document at
that time, can this be done???

Jo




  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default User Merge Field

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


"Gert Raes" wrote in message
...
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 ?

"Peter Jamieson" wrote:

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

"Jo Davis" wrote in message
...
Hi

I am trying to create a merge document, i want to insert a merge field
of
the user that is logged onto the computer and using the merge document
at
that time, can this be done???

Jo





  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default User Merge Field

Peter was the omission of the closing quote after "Gert or "GERT an
oversight or a bit of shorthand?

--
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

"Peter Jamieson" wrote in message
...
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


"Gert Raes" wrote in message
...
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 ?

"Peter Jamieson" wrote:

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

"Jo Davis" wrote in message
...
Hi

I am trying to create a merge document, i want to insert a merge field
of
the user that is logged onto the computer and using the merge document
at
that time, can this be done???

Jo








  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default User Merge Field

Doug...

It was a mistake...

Peter
"Doug Robbins - Word MVP" wrote in message
...
Peter was the omission of the closing quote after "Gert or "GERT an
oversight or a bit of shorthand?

--
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

"Peter Jamieson" wrote in message
...
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


"Gert Raes" wrote in message
...
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 ?

"Peter Jamieson" wrote:

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

"Jo Davis" wrote in message
...
Hi

I am trying to create a merge document, i want to insert a merge
field of
the user that is logged onto the computer and using the merge
document at
that time, can this be done???

Jo







  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default User Merge Field

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

"Peter Jamieson" wrote in message
...
Doug...

It was a mistake...

Peter
"Doug Robbins - Word MVP" wrote in message
...
Peter was the omission of the closing quote after "Gert or "GERT an
oversight or a bit of shorthand?

--
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

"Peter Jamieson" wrote in message
...
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


"Gert Raes" wrote in message
...
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 ?

"Peter Jamieson" wrote:

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

"Jo Davis" wrote in message
...
Hi

I am trying to create a merge document, i want to insert a merge
field of
the user that is logged onto the computer and using the merge
document at
that time, can this be done???

Jo








Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Includetext Merge Field Jan Mailmerge 1 April 19th 05 01:36 AM
Enhance merge to email feature of word with cc: merge field. Efficeint Word User Mailmerge 2 April 5th 05 05:05 AM
Date Field in Merge Document Karen Hart Mailmerge 35 March 29th 05 12:38 PM
Home Phone field not getting picked up in Merge Cathleen McGuire Mailmerge 4 January 7th 05 03:13 AM
suppress invalid merge field word 2003 Mike Mailmerge 3 December 9th 04 11:13 AM


All times are GMT +1. The time now is 07:28 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"