Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word - Can you create Identical/Duplicated Fields 2

Status
Not open for further replies.

PWD

Technical User
Jul 12, 2002
823
GB
We have a daily run sheet and the fields (Day and Date)can be update at print time. This is on page 1. We have to sign off page three so it would be good if the field that we update on the first page could also be (say) in the footer of page three. I think this is a wish too far, but if you don't ask you don't get! At the moment I just have "Printed date, Friday 11th April 2008" so we can probably work out this is the Monday run sheet. I did something a few years ago based on some of macropod's wise words but that was all contained in a table and worked out what to print without updating the fields at print time, i.e. if the Day number was whatever Friday is, add 3 and print Monday. Unfortunately that sheet was scrapped along with my code. Anyway 18:00 in UK so it's quitting time, but I'll be looking on Monday; thanks in advance. Des.
 
Identify the text/field to be dupicated with a bookmark. Then use a Ref field using the bookmark name.
(Insert > Field)
 
Hi PWD,

If you're looking for a calculated date, refer to my Date Calc 'tutorial', at:
or

If you simply want to replaicate a date that appears on one page somewhere else in the document, bookmark the first instance of the date and insert a cross-reference to the bookmark wherever else you want it to appear.

Cheers

[MS MVP - Word]
 
Hot, HOt, HOT!!!! Thank you both. Easy to do - even at 08:30 on a Monday. LOL.

It looks good and works a dream.

Des.
 
... apart from; the fields on the first page prompts for an update at print time BUT the fields in the footers don't get updated prior to the print so the two dates are out of synch. Once the document has been printed OR you update the field manually and then go to Print Preview, they are back in step!

Aaahhhhhhhhhhhh!!!

Can anyone think of a neat solution as I have to share this document with others in the IT Department?

Thanks, Des.
 
Hi PWD,

That's fairly standard behaviour with fields, unless their used in a document protected for forms where the update can be triggered by setting a formfield's 'calculate on exit' property'.

Cheers

[MS MVP - Word]
 
Thanks macropod. I had to find another way around as I'm only using Word 2000. What I did was put a command button on the form with the following code behind it.

Code:
Private Sub CommandButton1_Click()
ActiveDocument.Unprotect
    
    Selection.WholeStory
    Selection.Fields.Update
    Selection.HomeKey Unit:=wdStory


    ActiveDocument.PrintPreview
    ActiveDocument.ClosePrintPreview
    Application.WindowState = wdWindowStateMaximize
    
    ActivePrinter = ""
    Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
        wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
        Collate:=True, Background:=True, PrintToFile:=False, PrintZoomColumn:=0, _
        PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0


        
ActiveDocument.Protect Type:=wdAllowOnlyFormFields
End Sub
This prompts to amend the FillIn fields and then updates the field in the footers prior to printing. Woo hoo!!!! I guess it's not too elegant but it works from one click of the button.

Thanks again, Des.
 
Hi PWD,

I'm confused: You've apparently got FILLIN fields, but you're protecting the document for forms. Ordinarily, one wouldn't use such a combination.

Unless you're using formfields somwhere, I'd suggest getting rid of the document protection - that's what's preventing the date calculation in the footer from updating at print time. And then you won't need the macro either.

Cheers

[MS MVP - Word]
 
That's my problem; the 'Ref' fields in the footer don't update at print time (from the FILLIN fields on page one) and still print out with the previous day's date. It's only in an attempt to fix this that I've written the macro and inserted a button to run the macro. In order to activate the Macro (Control) Button I've had to protect the document as a Form. I don't know why she swallowed a fly! It IS clumsy, I'll admit, but the 'Ref' fields don't update prior to printing unless you shift to and from "Print Preview." Therefore the FILLIN fields need to be updated prior to this, then it all needs to be sent to the printer. If there's a sweeter way of doing all this (in Word 2000) I'd be glad to use that approach but I feel this is the only way to work around the way it works to get what I need. Thanks, Des.
 
Hi PWD,

Without seeing your document it's hard to figure out what's going on. Do you have the 'update fields' option checked under Tools|Options|Print?

Which field code example from my tutorial are you using?

Cheers

[MS MVP - Word]
 
Good morning! Yup, we've always had the 'update fields' option turned on and working fine. It's only when I've tried to this other thing that the problem has arisen - the 'Ref' fields don't update prior to printing. What I did was take the original FILLIN fields and then mark them each as a Bookmark. I then went into the footer on page 3 and inserted a Field, chose type 'Ref' and from the Options added the Bookmark to the field. This then displays what is in the original FILLIN field(s) - I have one for the 'Day' & one for the 'Date'. This is fine & dandy and I'm not sure whether or not it's due to these 'Ref' fields being in the footer, but when we print, the original FILLIN fields pop up for confirmation/amendment and then the document prints. It doesn't update the 'Ref' fields in the footer before printing, but they will be updated once the document has printed. I can send you the document if you think it would help. Just let me know where to send it. As I said, I only have Word 2000 at the moment, so I don't know if that makes a difference either. Des.
 
Hi PWD,

OK, How about this for a solution:

Put an ASK field in the footer and the cross-references to it (Hint: use Insert|Ctoss Reference) in both the footer and the body of the document. Do note though, that the field will only be triggered at print time - unlike the FILLIN field.

You could use your bookmarked FILLIN field in the footer instead, but doing that causes it to trigger twice at print time.

Cheers

[MS MVP - Word]
 
OK, time to give up on alternative solutions - thanks for trying for me. I tried both Insert Cross Reference the bookmark & Insert Ask and pointing at the default text for the bookmarks but neither of them update prior to printing - once the document has printed they update just fine! I'll admit that my macro triggers the fields twice but because the 'Ref' fields have been updated, by the Print Preview, we only have to click OK and not enter the data again so I guess we can live with that. Just tested by using Insert Cross Reference in the main body of the document and it does update; must be something to do with the footer. Oh well, I guess we can't always defeat the mighty Microsoft! Thanks again, Des.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top