Results 1 to 8 of 8
  1. #1
    Lounger
    Join Date
    Jun 2007
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Prefilling a table from a combo box in another doc

    I have a Word doc from which I need to open a new Word doc, prefilling table data on the new doc from the combobox data on the orignal.

    Any ideas?

    Thanks,
    Al

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

    Re: Prefilling a table from a combo box in another doc

    I'm afraid that you'll have to provide more detailed information than that. What you want is probably doable, but we'd need to have some idea of what combo box you mean and how you want to prefill the table.

  3. #3
    Lounger
    Join Date
    Jun 2007
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Prefilling a table from a combo box in another doc

    We have created a Project Dashboard that contains dropdowns and textboxes containing Departments, Project Name, etc. The documents are merged and printed on a monthly basis.

    One group has to provide the same information in a different format to an outside client and, rightfully so, is concerned about the effort required to replicate the information a second time even using cut/paste. The format they require contains tables into which the data can be copied.

    My

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

    Re: Prefilling a table from a combo box in another doc

    It would help if you attached a sample document (with sensitive information removed or altered, of course) and provided a detailed description of what you want to accomplish.

  5. #5
    Lounger
    Join Date
    Jun 2007
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Prefilling a table from a combo box in another doc

    Hans

  6. #6
    Lounger
    Join Date
    Jun 2007
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Prefilling a table from a combo box in another doc

    Hans -

    The 2nd doc... gets opened by the first.

    Al

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

    Re: Prefilling a table from a combo box in another doc

    1) The first table in the document being opened has only one row, so Cell(3, 1) is invalid.
    2) Unlike in Excel, you cannot simply set the value of a cell. You must set the Text of the Range of the cell.
    3) txtProjectName is not known in the document being opened. You must explicitly indicate that it belongs to the other document.

    Try this:

    ActiveDocument.Tables(1).Cell(1, 2).Range.Text = Documents("HANS-PROJECTDashboard.doc").txtProjectName

    You must, of course, use the correct name of the dashboard document. Does that help you on your way?

  8. #8
    Lounger
    Join Date
    Jun 2007
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Prefilling a table from a combo box in another doc

    Hans -

    FANTASTIC.... this does the trick.

    Thanks again,
    Al

Posting Permissions

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