Results 1 to 12 of 12
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Word app on Open does it update Fieldcodes? (OfficeXP SP3)

    Hi

    We have set custom fieldcodes & reference fieldcodes, that is the fieldcodes aren't set with any data yet. When we open up the Word document, our fieldcodes display as 'Error Reference source code not found'.

    For the end user this error message is scary.

    Is there another way I can disable or hide this error message?
    When the Word application opens up, does it update all the fieldcodes?
    I should also be asking...When the Word application opens up - what functions does it perform?


    Diana

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word app on Open does it update Fieldcodes? (OfficeXP SP3)

    Is it feasible to set the data to (for example) a single space, so that the reference fields will not display an error?

    See WD2000: Which Fields Are Updated When You Open, Repaginate, or Print Document? (it applies to Word 2002 too)

    When you start Word normally, it loads the application into memory, loads Normal.dot (and executes the AutoExec macro if present), loads all templates and documents in the Startup folder (as specified in the File Locations tab of Tools | Options...), and either creates a new blank document based on Normal.dot or opens one or more documents that were double clicked in Explorer.

  3. #3
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Word app on Open does it update Fieldcodes? (O

    Updating fields on open is an option that the users may or may not have set so it can't be relied on.

    Does updating the fields solve the problem? If so, why was the template not saved in this state instead?
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  4. #4
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word app on Open does it update Fieldcodes? (O

    Thanks for that.

    Its a 3rd party software with Word templates to plug into our environment.

    I was thinking a possible solution is to control Words repagination feature. Located in the Word menu Tools> Options> tab General> checkbox 'Background repagination'.

    In our current environment this setting 'Background repagination' is turned on. This means Word repaginates the document automatically as you work. This checkbox is only available in 'Normal View'. If the document is in page layout view, Word as a default automatically background repaginates in page layout view (you can't turn it off). We could turn off this Word setting , and with the 3rd party document/templates set them up as Normal View. And then via code we could control the Words Repagination feature for our Word templates. I would have to test and check that this would be a workable solution.

    back to the drawing board
    diana :-)

  5. #5
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Word app on Open does it update Fieldcodes? (O

    Diana

    Your original question relates to field codes and you seem to have morphed into talking about pagination. Are the two topics related? If they are then your fields must be in the headers and footers.

    Any fields in the headers and footers will be updated when the document displays the headers and footers in page layout view but this doesn't effect the fields in the body of the document. I don't think the fields in the headers and footers do update with pagination in Normal View. In Page Layout view, Word can't background repaginate - it has to foreground repaginate because it can't show you the page layout without getting the pagination right.

    If the fields causing the problems are only located in the headers and footers and your templates are saved in Normal View then the user will:
    1. See the updated fields on screen and print after changing to Page Layout view
    2. See the updated fields on print if they have set Word to automatically updated fields on Open or Print
    3. See the old non-updated fields on print if they have not changed views or have either of the above settings turned on.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  6. #6
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word app on Open does it update Fieldcodes? (O

    Hi Andrew

    I was wondering how to clear the fieldcodes message 'ERROR! NO DOCUMENT VARIABLE SUPPLIED.' eg see below screen capture of doc. It was orginally suggested, that on Words open it updates all the fields, as theres no data in the fields it displays the error. which to be is fine, however the users are wanting to remove/hide this message from the end user as it was scary.

    As it was along the lines of Words Open> & the ms weblinks in this posting, i got the impression that on Words pagination is when the fieldcodes get updated, therefore if I was to turn off the pagination it maybe a workaround for the fieldcodes error message. ii thought it may be a possible solution?

    diana
    Attached Images Attached Images

  7. #7
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Word app on Open does it update Fieldcodes? (O

    Diana

    The easy way to cure this would be to ensure that the document variable already exists in the document before they open the file - even if the contents of that variable contains nothing (or text that says "Update the Doc Variables") these fields would be happy.

    The hard way is to nest the field inside an if field so that it looks like the following. Note that the angle brackets are not standard angle brackets - they are field code brackets and can be inserted in pairs by typing Ctrl-F9.
    {If {DocVariable DV1}="Error! Document Variable not defined." "Update the Doc Variables Please" {DocVariable DV1}}
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  8. #8
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Word app on Open does it update Fieldcodes? (O

    Looking at your screen shot, you appear to have a mixture of { } characters inserted by typing Control-F9 (or using Insert Field) and others that have just been entered by typing the { and } keys on the keyboard.

    All of the { } characters need to be entered as field codes (by typing Control-F9, or using the Insert Field menu item).

    A bit of further experimentation shows that { DocVariable MC1MMASTER1 } returns an empty string if there is no such document variable. So the field code that works for me is...

    { If { Docvariable MC1MMASTER1 } = "" "Update the Doc Variables Please" "{ Docvariable MC1MMASTER1 }" }

    StuartR

  9. #9
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word app on Open does it update Fieldcodes? (O

    Hey Andrew

    Thanks for that. I'm not familiar with setting up fieldcodes or the syntax of setting up fieldcodes.

    I used your sample fieldcode. When I toggle fieldcodes the field displays as
    MC1MMASTER1}=

    please see attached screen dump. any ideas?
    diana

    Graphic edited by <!profile=StuartR>StuartR<!/profile> to reduce the size
    Attached Images Attached Images

  10. #10
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word app on Open does it update Fieldcodes? (O

    hey andrew

    i've managed to clean up the default display for the fieldcode. pls see screen dump.
    However I still cant figure out how to display as a default "Update the Doc Variables Please"'

    cheers Diana <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    Graphic edited by <!profile=StuartR>StuartR<!/profile> to reduce the size
    Attached Images Attached Images

  11. #11
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Word app on Open does it update Fieldcodes? (O

    Diana

    After the = sign the bit in quotes needs to read EXACTLY the same as the error message you were getting with the field originally (possibly even with the capitalisation).

    NOTE: This error message may be different in different versions of Word - The message you are getting is different to the one I encounter. In Word 2002 I can get an error of Error! Document Variable not defined. if I don't supply a docvariable name but I get no error message if the DocVariable given does not exist. This appears to be in conflict with the error message you are getting - which version of Word are you using?

    You are also missing an opening quote for the value if false although this may not come into play in this case.

    To do this in stages, which lets you verify the syntax and understand what it is you are actually doing
    Create a field that looks like {If true "yes" "no"} - update and see the result, then reveal the codes and change the true to false and update to see the result
    If everything is working you will see firstly a yes then a no...

    Now change the second word (either true or false) to say value1=value1 - update and see the result, then change the second value1 to value2, update and see the result
    If everything is working you will see firstly a yes then a no...

    Now copy the original field giving you the problems and paste it in the location to replace the value1
    Now replace the value2 text with "Error! Document Variable not defined.", update and see the result, then update this value by deleting one letter from this string and update and see the result again, then update this value by replacing that one letter and update and see the result again.
    If everything is working you will see firstly a yes then a no, then a yes...

    Now reveal the codes again for the final touches.
    Replace the yes (leaving the quotes) with Update the Doc Variables Please
    Replace the no (leaving the quotes) with the contents of your clipboard - that is the same field used immediately after the if statement.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  12. #12
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word app on Open does it update Fieldcodes? (O

    hi andrew

    thanks for that. in understand the syntax of the fieldcode & whats required so i finally got it to work

    diana :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •