Reply
 
Thread Tools Display Modes
  #1   Report Post  
starkman
 
Posts: n/a
Default 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   Report Post  
Jay Freedman
 
Posts: n/a
Default

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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I divide a page into three sections? Bonnie Microsoft Word Help 3 May 8th 23 02:47 AM
Drop down menu under the word File at top of page Shewolf Microsoft Word Help 1 December 31st 04 11:29 PM
Continuous breaks convert to next page breaks Jennifer Hunt Microsoft Word Help 2 December 30th 04 05:45 PM
macro in word js Microsoft Word Help 1 December 28th 04 03:01 AM
saving the workspace Mike Microsoft Word Help 3 December 8th 04 11:32 PM


All times are GMT +1. The time now is 02:24 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"