Jean-Guy
Wed Jan 09 17:56:41 PST 2008
dedawson was telling us:
dedawson nous racontait que :
> I just had a Word form task dumped on me, which would not be a problem
> if I had spent a lot of time working with forms in the past.
>
> But I haven't.
>
> I need to create a form field, run a macro on entry (or exit, if more
> appropriate), and have the macro results end up in the form field when
> I'm done. For example, a one line macro that places the result of
> application.username into the field.
>
> Its probably very obvious to most everyone, but right now I'm missing
> it.
>
> thanks in advance
> david
I think it would be better if you took a step back and explained what you
actually need. You give an example, which might be necessary to your task,
but I am sure you need more than that. As stated, it is difficult to help
you with precise information because your needs are not all that clear...
What is "application.username? In the context of Word VBA, "application"
refers to Word itself, in which case the username would be the name you see
in the Personal Information tab of the Options under Tools. For this, you do
not need a macro, a single field will do the trick (Insert > Fields).
If you mean the network/Windows username, then this is a different story.
By the way, why does it have to be a "one-line macro"?
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site:
http://www.word.mvps.org