multi line form field

M

MT Laz

I wish to create a field in a Word form that will enable me to use a drop
down (or equivalent) to choose from a list of "Mailing Labels" which each
include Name, Address, City, St, Zip. Using a drop down form field only
allows me one line of information, and I need 3.
 
D

Doug Robbins - Word MVP

If you had the address details stored as autotext entries, you could use the
following code on exit from a DropDown type FormField to insert the address
corresponding to the selected name (company in the case for which the
following code was created) into a Text FormField on the following line.

' 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("Address").Result = Address

The alternative, and probably better approach is to use a userform

See the following pages of Greg Maxey's website :

http://gregmaxey.mvps.org/Create_and_employ_a_UserForm.htm

http://gregmaxey.mvps.org/Populate_UserForm_ListBox.htm


--
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, originally posted via msnews.microsoft.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top