Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Updating fields in Word
I am trying to save myself some typing in what I am doing but so far with
little luck. I'll try to explain this in something that looks like English. I have a base document named Base.DOC. Periodically I need to import the content of other documents into this documents. These imported documents have reference fields included in them so that I only have to type something once and the text is automagically inserted into other location in the document. All well and good so far. My problem arises when I need to insert the SAME document in the Base.DOC a second time. When this happens all the reference information entered the first time is entered into this new section. Is there any way to create break or modify the reference so that when the second or subsequent document is inserted the reference fields will refer to the most recent entry and not simply the first entry? |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Updating fields in Word
Reference (REF) fields reproduce the information stored in the bookmark they
refer to. It is not possible in the same document to have a REF field to refer to two different pieces of information. Where is the bookmark information coming from? Where is the second set of bookmark information coming from? Without seeing your document, you may be able to convert the first document REF fields to text before importing the second copy of the document and then update the bookmarked information. The original would then show the original bookmarked information, the inserted document would show the new bookmarked information. The following macro will fix all the REF fields in a document Sub FixRefFields() Dim oStory As Range Dim oField As Field For Each oStory In ActiveDocument.StoryRanges For Each oField In oStory.Fields If oField.Type = wdFieldRef Then oField.Update oField.Unlink End If Next oField If oStory.StoryType wdMainTextStory Then While Not (oStory.NextStoryRange Is Nothing) Set oStory = oStory.NextStoryRange For Each oField In oStory.Fields If oField.Type = wdFieldRef Then oField.Update oField.Unlink End If Next oField Wend End If Next oStory Set oStory = Nothing End Sub http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Mac wrote: I am trying to save myself some typing in what I am doing but so far with little luck. I'll try to explain this in something that looks like English. I have a base document named Base.DOC. Periodically I need to import the content of other documents into this documents. These imported documents have reference fields included in them so that I only have to type something once and the text is automagically inserted into other location in the document. All well and good so far. My problem arises when I need to insert the SAME document in the Base.DOC a second time. When this happens all the reference information entered the first time is entered into this new section. Is there any way to create break or modify the reference so that when the second or subsequent document is inserted the reference fields will refer to the most recent entry and not simply the first entry? |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Word 2003 Updating Fields | Microsoft Word Help | |||
Fields updating inconsistently in Word 2003 | Microsoft Word Help | |||
Updating fields in Word 2007 | Microsoft Word Help | |||
Using CTRL-A in Word 2007 but F9 is NOT updating fields? | Microsoft Word Help | |||
Automatically updating Fields in Word? | Microsoft Word Help |