Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2007

Tip: Looking for answers? Try searching our database.

How do I auto populate a field based off of my list selection

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Julie - 30 Mar 2007 01:18 GMT
OK, here it goes :)

I dont know anything about VBA and I'm thinking I will need to learn to do
what I want to do in my .doc.

I have a table of 'contact info' in my document which I'm going to lock so
that it will be used as a template for others (where they can only update
certain fields and select information that I've provided).

I have two lists now in .doc but it's messy...l:
Name         Email address

Currently if I pick the name, then I have to go to the Email address list
and pick the corresponding email address.

What I want to have happen is if I pick a Name on the left, the Email
address will autopopulate in the list by itself.

One step further, and even better:
To not even have an email address 'list', but have word just insert the
email address in the cell to the right of "Name"...I just don't know how to
create the list of values for it to populate based off of the selection in
the list.

Again, I don't know VBA here so please be clear :)))

Thank you for any help,
Julie
macropod - 30 Mar 2007 07:16 GMT
Hi Julie,

If you've got Excel, this would really be much easier to do there. Excel has built in functions for looking-up and returning data
from a table, without the need to resort to vba.

Cheers
Signature

macropod
[MVP - Microsoft Word]
-------------------------

> OK, here it goes :)
>
[quoted text clipped - 24 lines]
> Thank you for any help,
> Julie
Julie - 31 Mar 2007 00:16 GMT
Hi macropod,

Unfortunately the template must stay .doc :(.

Thanks!
Julie

> Hi Julie,
>
[quoted text clipped - 30 lines]
> > Thank you for any help,
> > Julie
Doug Robbins - Word MVP - 30 Mar 2007 21:23 GMT
If you create an autotext entry containing each email address with that
autotext entry having the corresponding name that would be in the list from
which you want the users to pick (actually assumed to be a DropDown type
FormField as you say that you are going to protect the document, you could
use the following code in a macro that is run on exit from the DropDown
FormField:

' Macro created 15-11-97 by Doug Robbins to add the address corresponding to
a drop down name

'

Set myDrop = ActiveDocument.FormFields("Dropdown1").DropDown

Company = myDrop.ListEntries(myDrop.Value).Name

Address = ActiveDocument.AttachedTemplate.AutoTextEntries(Company).Value

ActiveDocument.FormFields("Text1").Result = Address

End Sub

I would suggest however that you consider the use of a user form, but you
will have a bit of learning to do.  In the first instance, you should
probably work your way through the following articles

Please Fill Out This Form
Part 1: Create professional looking forms in Word
http://www.computorcompanion.com/LPMArticle.asp?ID=22

Part 2: Adding Automation to your Word forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=46

Part 3: Learn more VBA (macros) to automate your forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=119

Part 4: Use custom dialog boxes in your Word forms
http://www.computorcompanion.com/LPMArticle.asp?ID=127

Part 5: Connect your AutoForm to a database to save input time and keep
better records!
http://www.computorcompanion.com/LPMArticle.asp?ID=136

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

> OK, here it goes :)
>
[quoted text clipped - 25 lines]
> Thank you for any help,
> Julie
Julie - 31 Mar 2007 00:16 GMT
Thank you Doug.

This is a great start for me and you've provided wonderful direction :)

I was actually hoping for a response like this one so that I can educate
myself on VBA, user forms, etc. I had been searching high and low and didn't
know where to start.

Thanks again,
Julie

> If you create an autotext entry containing each email address with that
> autotext entry having the corresponding name that would be in the list from
[quoted text clipped - 68 lines]
> > Thank you for any help,
> > Julie
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.