View Single Post
  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default auto-fill the next 3 fields when selecting text from a dropdow

If you prefer the macro solution, then the macro I posted earlier using your
further information would be

Sub OnExitDD1()
'fills text field based on content of _
dropdown field

Dim oFld As FormFields
Set oFld = ActiveDocument.FormFields
Select Case oFld("NAME").Result

Case Is = "Willie Smith"
oFld("POSITION").Result = "DIR"
oFld("EXT").Result = "111"
oFld("EMAIL").Result = "wsmith"

Case Is = "John Jones"
oFld("POSITION").Result = "Ad Ops"
oFld("EXT").Result = "112"
oFld("EMAIL").Result = "jjones"

Case Is = "Gail Storms"
oFld("POSITION").Result = "AdSales"
oFld("EXT").Result = "120"
oFld("EMAIL").Result = "gstorms"

Case Else
'Do nothing
End Select
End Sub

Set the bookmark name of the dropdown field to NAME
the bookmark name of the position field to POSITION
the bookmark name of the extension field to EXT
and the bookmark name of the email field to EMAIL

(right click the fields properties)

See http://www.gmayor.com/installing_macro.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Freddie Fredricks wrote:
I currently have 3 names - 3 postions - 3 Exts & 3 emails (each email
is identical after @...... sample:

[NAME] [POSITION] [EXT]
[email] @abc.com
Willie Smith DIR 111
wsmith John Jones AD Ops 112
jjones Gail Storms AD Sales 120
gstorms

Appreciate any help



"Suzanne S. Barnhill" wrote:

You may not need a macro; this can be done with IF fields, though it
can get pretty messy if there are a lot of names. How many names are
there? Provide some sample names and positions, and I'll provide
some sample IF fields.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

"Freddie Fredricks" Freddie
wrote in message
...
I currently have 4 dropdown fields on a form: Name - Position -
Ext. Email. I want the Position - Ext. & Email fields to auto-fill
with the correct info, when a name is selected. Note: Each name
has unique data for each field. I am ignorant when it comes to
macros, so I need to have my hand held through this one. Thanks.