Re: Populating text boxes with macros in dropdowns
- From: "Doug Robbins - Word MVP" <dkr@xxxxxxxxxxxxxxxxxx>
- Date: Thu, 4 Oct 2007 19:26:55 +1000
Code such as the following can be used to populate a formfield with an
autotext entry that corresponds to an item selected from a dropdown type
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
--
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
"Bikertyke" <Bikertyke@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9F9E2E65-09F5-4AE1-A89F-F52F1152EAE3@xxxxxxxxxxxxxxxx
I'm trying to produce a document in WORD 03 that will allow a user to
select
items from dropdowns in a list of contents that will then populate text
boxes
in other areas of the document with information relevant to the selection
made in the dropdown e.g. if the user selects apples from the drop down
the
description will automatically be populated with, say "fresh and crunchy,
ideal for snacks' and the colour will populate with 'red'. If the user
selects pears different descriptions and colour would be used.
It would also be preferable for the dropdown and text box to be removed if
no selection is made in order that no gaps are left in the body of the
document.
Ideas for macro's gratefully recieved as programing is not a strong point.
.
- Prev by Date: Re: save button Word 2003
- Next by Date: DOCVARIABLES + BLANK
- Previous by thread: Re: save button Word 2003
- Next by thread: DOCVARIABLES + BLANK
- Index(es):