Problem arises when ref bookmark is added in the header ,it does not take the modified values and di

D

divya

Problem arises when ref is added in the header ,it does not take the
modified values of the bookmarks and displays the same old values.


The problem with ref what am facing is:

1.First time I enter the data in form it takes these values and on the
header where I have added REF Bookmark copies these values as
needed.

2.But when I overite or make changes to previously enterd data it
doesn't modify the header and shows me in the header the prev old
values.

3.Now I save & close this document .

4.When I Reopen and fill the form,now the header shows me the
same old values the ones b4 closing.


Header is only taking the values when the REF was first executed.


Kindly suggest a solution.Do I need to add any macro which forces the
execution of the REF in the header when any of the data in the Book
marks is changed??Plz help me with the code.Can this be done using
REF,I mean capturing values from the form and repeating them in the
header???

regards,
Divya


Plz help me out ,I need to finishi the assingnemnt today.
Cheerz
Divya



- Hide quoted text -
- Show quoted
 
G

Graham Mayor

REF fields in headers don't automatically update. You have to force an
update. You could add the update macro at
http://www.gmayor.com/installing_macro.htm to your toolbar to make things
easy, or investigate whether Styleref fields will do what you want - as they
do update.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Graham Mayor

REF fields in headers don't automatically update. You have to force an
update. You could add the update macro at
http://www.gmayor.com/installing_macro.htm to your toolbar to make things
easy, or investigate whether Styleref fields will do what you want - as they
do update.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
D

divya

I got the problem solved by adding a macro which updates all the
references of the bookmarks .

Sub myUpdateFields()
Dim pRange As Word.Range
Dim iLink As Long
iLink = ActiveDocument.Sections(1).Headers(1).Range.StoryType
For Each pRange In ActiveDocument.StoryRanges
Do
pRange.Fields.Update
Set pRange = pRange.NextStoryRange
Loop Until pRange Is Nothing
Next
End Sub

Add this in the onexit event of the text fields

I got this from http://gregmaxey.mvps.org/Field_Macros.htm

This link is really good for repeating the form text in whichever part
of document u need.
http://gregmaxey.mvps.org/Repeating_Data.htm
 
D

divya

I got the problem solved by adding a macro which updates all the
references of the bookmarks .

Sub myUpdateFields()
Dim pRange As Word.Range
Dim iLink As Long
iLink = ActiveDocument.Sections(1).Headers(1).Range.StoryType
For Each pRange In ActiveDocument.StoryRanges
Do
pRange.Fields.Update
Set pRange = pRange.NextStoryRange
Loop Until pRange Is Nothing
Next
End Sub

Add this in the onexit event of the text fields

I got this from http://gregmaxey.mvps.org/Field_Macros.htm

This link is really good for repeating the form text in whichever part
of document u need.
http://gregmaxey.mvps.org/Repeating_Data.htm
 

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