#1
|
|||
|
|||
If field
I apologize I this was previously answered but I did not managed to find it.
I have a form with the dropdown box 'Sex' (male/female) and multiple dependant IF Fields that change only when I click on them and select Update field. What I need is all of them to change automatically when value of the Sex Dropdown Box is selected. I am an Open Office user where such update happens automatically; unfortunately I need to implement this form in MS Word and was not able to find a solution. I would appreciate any help. Vanja |
#2
|
|||
|
|||
You can update all fields in a document by calling the following macro from your dropdown change event:
Public Sub UpdateAllFields() Dim rngStory As Word.Range Dim lngJunk As Long Dim oShp As Shape lngJunk = ActiveDocument.Sections(1).Headers(1).Range.StoryT ype For Each rngStory In ActiveDocument.StoryRanges 'Iterate through all linked stories Do On Error Resume Next rngStory.Fields.Update Select Case rngStory.StoryType Case 6, 7, 8, 9, 10, 11 If rngStory.ShapeRange.Count > 0 Then For Each oShp In rngStory.ShapeRange If oShp.TextFrame.HasText Then oShp.TextFrame.TextRange.Fields.Update End If Next End If Case Else 'Do Nothing End Select On Error GoTo 0 'Get next linked story (if any) Set rngStory = rngStory.NextStoryRange Loop Until rngStory Is Nothing Next End Sub |
#3
|
|||
|
|||
Many thanks.
Vanja |
#4
|
||||
|
||||
If it's a formfield, all you should need to do is to check the 'Sex' dropdown box's 'calculate on exit' property.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
All fields are formfields, and 'calculate on exit' is checked for Sex field, but other fields does not change when Sex value is changed.
Vanja |
#6
|
||||
|
||||
Unless you can show us the field coding you're using (eg by attaching a stripped down document to a post), it's difficult for anyone to offer more help.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ASK and REF field problem | ilkks | Word | 3 | 05-26-2011 01:58 AM |
How to refer a field in another field | DaveSmith | Word | 0 | 08-24-2010 06:44 PM |
Field Help | BChianciola | Word | 0 | 11-09-2009 01:14 PM |
Infopath field | mjv | Misc | 0 | 12-27-2008 08:19 AM |
Printing BCC field | John Strung | Outlook | 4 | 11-22-2005 04:48 PM |