Graham
Thu May 26 23:10:56 CDT 2005
Somewhat baffled as here that field combination updates itself without
external updating. Only the filename field requires a forced update. Had you
not said that it works if you print the document, I would have concluded
that you had not entered a field combination but merely typed it as shown in
the post. Just to be absolutely sure we are singing from the same hymn
sheet, I take it you did insert the fields using CTRL+F9 for the field
boundaries?
I'd ask you to send the document, but I am in the process of relocating and
I am currently working with a very slow and expensive temporary dial-up
connection.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site
http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
John wrote:
> Yes I did. It updates the Filename OK but not the second field which
> should result in " /more" when the document is more than 1 page
> long.
>
> John
>
> "Graham Mayor" <gmayor@DELETECAPSmvps.org> wrote in message
> news:eVnJVmhYFHA.3188@TK2MSFTNGP09.phx.gbl...
>> Did you try the second option?
>>
>> --
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>> Graham Mayor - Word MVP
>>
>> My web site www.gmayor.com
>> Word MVP web site
http://word.mvps.org
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>
>>
>>
>> John wrote:
>>> Thanks for that. Unfortunately, PrintPreview doesn't update this
>>> particular field. If I use PrintPreview from the File menu it stays
>>> the same. It's only when I actually Print the document that it
>>> updates. Unfortunately, these documents are normally emailed and
>>> therefor seldom printed.
>>>
>>> John
>>>
>>> "Graham Mayor" <gmayor@DELETECAPSmvps.org> wrote in message
>>> news:u0FT2abYFHA.2664@TK2MSFTNGP15.phx.gbl...
>>>> Assuming the second part is actually a field and not merely typed
>>>> from the keyboard then try
>>>>
>>>> Options.UpdateFieldsAtPrint = True
>>>> Application.ScreenUpdating = False
>>>> PrintPreview = True
>>>> PrintPreview = False
>>>> ActiveDocument.ActiveWindow.View.Type = wdPrintView
>>>> Application.ScreenUpdating = True
>>>>
>>>> or
>>>>
>>>> Dim oField As Field
>>>> Dim oSection As Section
>>>> Dim oHeader As HeaderFooter
>>>> Dim oFooter As HeaderFooter
>>>>
>>>> For Each oSection In ActiveDocument.Sections
>>>> For Each oHeader In oSection.Headers
>>>> If oHeader.Exists Then
>>>> For Each oField In oHeader.Range.Fields
>>>> oField.Update
>>>> Next oField
>>>> End If
>>>> Next oHeader
>>>> For Each oFooter In oSection.Footers
>>>> If oFooter.Exists Then
>>>> For Each oField In oFooter.Range.Fields
>>>> oField.Update
>>>> Next oField
>>>> End If
>>>> Next oFooter
>>>> Next oSection
>>>>
>>>>
>>>> --
>>>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>>> Graham Mayor - Word MVP
>>>>
>>>> My web site www.gmayor.com
>>>> Word MVP web site
http://word.mvps.org
>>>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>>>
>>>>
>>>> John wrote:
>>>>> Hi,
>>>>>
>>>>> I have the following Field in the footer of a template. It updates
>>>>> fine when printed but I am trying to get it to update when I do a
>>>>> FileSaveAs.
>>>>>
>>>>> {FILENAME \* Lower \* MERGEFORMAT }{if{numpages}>{page}"
>>>>> /more"}
>>>>>
>>>>> I have included some code to update these fields and the FILENAME
>>>>> updates OK, but the second part doesn't.
>>>>>
>>>>> Sub FileSaveAs()
>>>>> For Each pRange In ActiveDocument.StoryRanges
>>>>> Do
>>>>> For Each oFld In pRange.Fields
>>>>> oFld.Update
>>>>> Next oFld
>>>>> Set pRange = pRange.NextStoryRange
>>>>> Loop Until pRange Is Nothing
>>>>> Next
>>>>> End Sub
>>>>>
>>>>> Any suggestions what I can do to make the second part update?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> John