Re: How do I auto populate a field based off of my list selection
- From: Julie <Julie@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 30 Mar 2007 16:16:01 -0700
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
"Doug Robbins - Word MVP" wrote:
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
--
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
"Julie" <Julie@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:6D768DAC-B243-4D4E-B318-86DF916EA435@xxxxxxxxxxxxxxxx
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
- References:
- Re: How do I auto populate a field based off of my list selection
- From: Doug Robbins - Word MVP
- Re: How do I auto populate a field based off of my list selection
- Prev by Date: Re: Having a Macro Icon Toggle
- Next by Date: Re: password protecting printing in a protected doc?
- Previous by thread: Re: How do I auto populate a field based off of my list selection
- Next by thread: Re: VB6 Word Automation Printing Problem Vista Op system
- Index(es):
Relevant Pages
|