none
Duplicating field groupings in Word RRS feed

  • Question

  • I'm new to advanced Word so this could be an easy one.  Here's what I'm attempting to do:

    Create a word template that will be filled out as a form.  There are multiple categories such as "CLient ISP".

    Is there a way for the end user to hit a button to create a second iteration of the category.  Let's say it's a table like this:

    1. Client ISP Name: (answer field)

    2. Client IP Address: (answer field)

    3 Client Connection Type: (answer field)

    If the client has multiple ISPs, I'd need a second copy of this table.  I know this can be done within Infopath but I'm trying to do it in Word.  I've already created the template to the best of my ability and can post it if need be.

    Saturday, March 5, 2011 7:30 PM

Answers

  • Depends upon the type of form that you are using.

    If it was a userform (a custom dialog box) I would have controls for ISP Name, IP Address and Connection type information and a button that added the entered information into a list box so that you would build up a list of that information.  I would also have an Edit and Delete button that would allow the user to Edit or Delete and item from the List box.

    If you are using an online form (FormFields in a document that is protected for Filling in Forms), a macro containing code such as the following can be run on exit from the last of the formfields to add another row of formfields if required:

    Sub addrow()
    '
    ' Macro created 02/02/03 by Doug Robbins
    ' To add a new row to a table containing formfields in every column
    ' automatically on exit from the last cell in the present last row of the table
    Dim rownum As Integer, i As Integer
    If MsgBox("Do you want to add additional data", vbYesNo + vbQuestion) = vbYes Then
       With ActiveDocument
           .Unprotect
           .Tables(1).Rows.Add
           rownum = .Tables(1).Rows.Count
           For i = 1 To .Tables(1).Columns.Count
               .FormFields.Add Range:=.Tables(1).Cell(rownum, i).Range, Type:=wdFieldFormTextInput
           Next i
           .Tables(1).Cell(.Tables(1).Rows.Count, .Tables(1).Columns.Count).Range.FormFields(1).ExitMacro = "addrow"
           .Tables(1).Cell(.Tables(1).Rows.Count, 1).Range.FormFields(1).Select
           .Protect Type:=wdAllowOnlyFormFields, NoReset:=True
       End With
    End If
    End Sub


    Hope this helps.

    Doug Robbins - Word MVP,
    dkr[atsymbol]mvps[dot]org
    Posted via the Community Bridge

    "Seth Zwicker" wrote in message news:8c2285a9-b975-4b64-8d3f-d0eaeb154ada@communitybridge.codeplex.com...

    I'm new to advanced Word so this could be an easy one.  Here's what I'm attempting to do:

    Create a word template that will be filled out as a form.  There are multiple categories such as "CLient ISP".

    Is there a way for the end user to hit a button to create a second iteration of the category.  Let's say it's a table like this:

    1. Client ISP Name: (answer field)

    2. Client IP Address: (answer field)

    3 Client Connection Type: (answer field)

    If the client has multiple ISPs, I'd need a second copy of this table.  I know this can be done within Infopath but I'm trying to do it in Word. I've already created the template to the best of my ability and can post it if need be.


    Doug Robbins - Word MVP dkr[atsymbol]mvps[dot]org
    • Marked as answer by Bessie Zhao Friday, March 11, 2011 10:23 AM
    Saturday, March 5, 2011 9:29 PM