Templates

L

LookingGood

I am new to the group and good day to all.

I have the knowledge to create basic templates with no macro skills. I am
currently involved in a project to create some sophisticated requirements in
template design. I am a 4GL programmer with the ability to create functional
program specs. The following are issues that I am desperately seeking help.

1. By default a single row table with 4 cells, 1st = display, 2nd, 3rd & 4th
cells bookmarked as AccNo, AccName & AccAmt respectively for user input.
Question: When the user tabs to the last input field AccAmt, a window popup
to display "New line required (Yes/No)", if Yes then the following should
happen.
(Row2, Cell1) should be same as (Row1, Cell1)
(Row2, Cell2) field details should be identical as (Row1, Cell2) except the
bookmark should read AccNo_2 [2 is the row number]
(Row2, Cell3) field details should be identical as (Row1, Cell3) except the
bookmark should read AccName_2
(Row2, Cell4) field details should be identical as (Row1, Cell4) except the
bookmark should read AccAmt_2
and so forth.....
Also required, a variable that I can indentify the number of rows in this
table.

If there is a more easier way of setting up this table, I would gladly
accept any cosideration. As mentioned above, I do not have any experience in
writing macros.

PS. I have posted the same question yesterday with lesser details. Sorry
about that.

Thanks in advance
 
D

Doug Robbins - Word MVP

See the article "What do I do with macros sent to me by other newsgroup
readers to help me out?" at:
http://www.word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm

You are going to need some macro skills to do this.

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 Long, i As Long
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(ActiveDocument.Tables(1).Rows.Count, 1) _
.Range.FormFields(1).Select
.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End With



End Sub

Also see:

Please Fill Out This Form
Part 1: Create professional looking forms in Word
http://www.computorcompanion.com/LPMArticle.asp?ID=22

Part 2: Adding Automation to your Word forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=46

Part 3: Learn more VBA (macros) to automate your forms.
http://www.computorcompanion.com/LPMArticle.asp?ID=119

Part 4: Use custom dialog boxes in your Word forms
http://www.computorcompanion.com/LPMArticle.asp?ID=127

Part 5: Connect your AutoForm to a database to save input time and keep
better records!
http://www.computorcompanion.com/LPMArticle.asp?ID=136


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

LookingGood said:
I am new to the group and good day to all.

I have the knowledge to create basic templates with no macro skills. I am
currently involved in a project to create some sophisticated requirements
in
template design. I am a 4GL programmer with the ability to create
functional
program specs. The following are issues that I am desperately seeking
help.

1. By default a single row table with 4 cells, 1st = display, 2nd, 3rd &
4th
cells bookmarked as AccNo, AccName & AccAmt respectively for user input.
Question: When the user tabs to the last input field AccAmt, a window
popup
to display "New line required (Yes/No)", if Yes then the following should
happen.
(Row2, Cell1) should be same as (Row1, Cell1)
(Row2, Cell2) field details should be identical as (Row1, Cell2) except
the
bookmark should read AccNo_2 [2 is the row number]
(Row2, Cell3) field details should be identical as (Row1, Cell3) except
the
bookmark should read AccName_2
(Row2, Cell4) field details should be identical as (Row1, Cell4) except
the
bookmark should read AccAmt_2
and so forth.....
Also required, a variable that I can indentify the number of rows in this
table.

If there is a more easier way of setting up this table, I would gladly
accept any cosideration. As mentioned above, I do not have any experience
in
writing macros.

PS. I have posted the same question yesterday with lesser details. Sorry
about that.

Thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top