Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Word & Drop Down Menu's
Let's say I have a word document with many drop down menus, each with the same amount of lines in each. Example: each drop down menu has 12 lines of data to choose from but each menu's data is different. It so happens that If I select the fourth line down on one drop down field, then I will want the fourth line down on all of the drop down fields. But the only way I can do it now is to manually change all of them by hand. Is there a way to make this automated?? -- starkman |
#2
|
|||
|
|||
On Thu, 25 Nov 2004 20:56:18 +0000, starkman
wrote: Let's say I have a word document with many drop down menus, each with the same amount of lines in each. Example: each drop down menu has 12 lines of data to choose from but each menu's data is different. It so happens that If I select the fourth line down on one drop down field, then I will want the fourth line down on all of the drop down fields. But the only way I can do it now is to manually change all of them by hand. Is there a way to make this automated?? You need a macro to do that. Add the following macro to the template, and then set it as the exit macro in each dropdown's Properties dialog. The macro will run when you exit any dropdown by tab key or mouse, and change all the other dropdowns to match. Public Sub DDexit() ' set all dropdown fields to the ' same index Dim nIndex As Long Dim oFld As FormField, oThisFld As FormField On Error GoTo trap If Selection.FormFields.Count Then Set oThisFld = Selection.FormFields(1) If oThisFld.Type = wdFieldFormDropDown Then nIndex = oThisFld.DropDown.Value For Each oFld In ActiveDocument.FormFields If oFld.Type = wdFieldFormDropDown Then oFld.DropDown.Value = nIndex End If Next oFld End If End If Exit Sub trap: If Err.Number = 4608 Then MsgBox "One of the dropdowns is missing entries" End If End Sub -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I divide a page into three sections? | Microsoft Word Help | |||
Drop down menu under the word File at top of page | Microsoft Word Help | |||
Continuous breaks convert to next page breaks | Microsoft Word Help | |||
macro in word | Microsoft Word Help | |||
saving the workspace | Microsoft Word Help |