• Moving data between docs (Word 2000)

    Author
    Topic
    #377062

    I have to automate a pair of rather long forms.

    Form A (8 pages) is completed first. Form B is filled out a couple of weeks after Form A. It uses 80% of the data on Form A, but adds more material. Users want to eliminate retyping or cut and paste when filling out Form B, and want to “idiot proof” as much of the completion process as possible.

    I have created two Word forms. Both use tables for layout and are populated with data fields, then protected. Both have been turned into templates. The data fields in each correspond. For example, the data field containing the form’s original date bears the same name in both templates.

    Now I need to get data from Form A into Form B, but frankly I’m at the edge of my ability. Here are three possible methods. There may be more, but they are not evident to me:

    1. Use an Access database as a “way station” into which Form A’s data can be dumped, then retrieved by Form B. (Not high on my ease-of-doing-this list, both for me as creator and the largely beginner-level user base).

    2. Open Form B, and using a macro directly retrieve data from Form A into corresponding fields on Form B. I don’t see any examples or discussion of someone else having done this in any of the Word-Expert forums. Is it even possible?

    3. Open Form A, then use a macro to transform the document into Form B by adding pages, table rows, and whatever else is needed – then flagging the new fields that need to be completed.

    Are these the only three possibilities? Any and all advice on the best way to go about doing this would be greatly appreciated.

    ksalazar

    Viewing 0 reply threads
    Author
    Replies
    • #619999

      Hi ksalazar:
      This seems like a natural for the includetext field. In Form A, bookmark the parts of the document which need to be “copied”. In Form B, use the following syntax:

      { INLCUDETEXT “C:FolderSubfolderFormA.doc” BookmarkName }

      The brackets are inserted by pressing Ctrl+F9. Note the use of double backslashes. If the information that you are copying from Form A is a field itself (such as a {DATE} field), you will need to use the ! switch at the end to prevent the field from updating. i.e. you want the date that exists in Form A, not the date that Form B was produced.

      Cheers,

      • #620004

        Phil,

        I grovel at your feet in thanks! I will set up a userform in front of Form B to query the user for the specific docname of the Form A that needs to be transformed into Form B. I should be able to feed that input into the INCLUDETEXT statement.

        In gratitude,
        -K. (getting the hang of this…)

      • #620978

        Phil,

        Again thank you! With your advice I’ve got the first half of the scenario working now. I have IncludeText statements in Form B looking up data from Form A and including that info where required.

        Now I want to make life simpler for the person doing the entry. There will be many, many Form As. Each will (down the pike) need to be transformed into Form B. Each Form B has about 35 different spots in it where text needs to be retrieved from Form A and included in Form B. All of the Form A data source spots have unique bookmark names. I want to make the IncludeText statement work along this logical line:

        First, somewhere else in the form, placed there via a User Form (which I’ve gotten working) – the full path name of the Form A document, input with doubled s. For sake of argument, let’s say the bookmark name is FormAPath and that the actual form A path as entered by the user is D:worddocsFormA-sample.doc

        I’m having a devil of a time doing this, but now I want InsertText to read the path name from my FormAPath bookmark, then append the specific reference point to it (in this case, I want to retrieve the contents of the Form A field ProjectName. This syntax is assuredly wrong, but you can get an idea of what I’m trying to do here:

        {IncludeText “”ProjectName /!}

        Try as I might, I can’t figure out how to get the IncludeText statement to accept the contents of a field in the current document as part of the path name argument for referecing my data source.

        Is this possible?

        Again copious thanks from this newbie for any and all guidance (and patience).
        KSalazar

        • #620992

          If I have a bookmark “FileName” in the current document that contains the filename (no doubled characters) and a bookmark called BmkName in the target document, then this syntax seems to do the correct thing for me.

          { INCLUDETEXT
        • #621037

          Hi K:
          I see Stuart has given you the answer. One thing I would mention is make sure that your switch is !, as in Stuart’s post. I notice that you typed /!, but I understand that it may just be a typo. I get mixed up between forward & backslashes–some day I’ll make a list & keep it next to the computer. laugh

    Viewing 0 reply threads
    Reply To: Moving data between docs (Word 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: