Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Jul 2005
    Location
    Minneapolis, Minnesota, USA
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Word 2003 (Windows XP)

    Hi,

    I need to create a reimbursement form. There will be an unspecified number of items to be reimbursed. I'd like to do a loop or if then if possible so that a table will keep being created as long as there are receipts to be added.

  2. #2
    Bronze Lounger IanWilson's Avatar
    Join Date
    Dec 2000
    Location
    Bristol, United Kingdom
    Posts
    1,523
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Word 2003 (Windows XP)

    You don't give many details, but one way would be to create a table just as you want it, for one item, then save the row on which the entries are made as a piece of autotext. You could create a toolbar button that would insert the autotext and it could be labelled something like "add another item".

    Or you could just educate users to press the Tab key at the end of the table to add another row.

    Ian

  3. #3
    New Lounger
    Join Date
    Jul 2005
    Location
    Minneapolis, Minnesota, USA
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word 2003 (Windows XP)

    Hi Ian,

    Thanks for the response -- good suggestions, but what I really want to do is to let people keep typing in the info in a user form and have it appear in the final document. I'll attach what I have so far so you can see what I'm talking about. Basically I'd like the frmReceipt to replicate until the user presses done. Hope I'm making sense.

    Thanks,

    Chris
    Attached Files Attached Files

  4. #4
    Bronze Lounger IanWilson's Avatar
    Join Date
    Dec 2000
    Location
    Bristol, United Kingdom
    Posts
    1,523
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Word 2003 (Windows XP)

    You are making some sense, but I am getting out of my depth here. However, I do have one suggestion. Are you sure that Word is the best thing to do this with or might you get on better with Excel?

    Ian

  5. #5
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts

    Re: Word 2003 (Windows XP)

    I suppose that each time the user clicks on, for example, "Add Item", you want to add a new row to the table and add information to the columns in that row. The following code will do that.

    ActiveDocument.Tables(1).Rows.Add

    But it sounds like you know that you are already in the last cell of the table because you will have just added some text in that cell. If so, the following code will create a new row and the cursor will be in the first column of the new row. In the above code, you would have to get to that cell (using the code below).

    Selection.MoveRight Unit:=wdCell

    Using the Selection object causes a bit of screen flickering. The Range object would be better, if you are familiar with that.

    In any case, whether the user types/tabs in the user form or directly into the table, it's the same amount of typing. Is there a compelling reason (drop-downs for expense types perhaps) to use a user form?

Posting Permissions

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