Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
LPS
 
Posts: n/a
Default Repeating Rows with Form Fields

I am using Word 2000 and need to have a new table row containing protected
form fields automatically generate when the TAB key is pressed at the end of
the last row, so that the new row automatically contains the same form
fields.

I have reviewed previous questions and found some with references to macros
and I have tried the macro below, with no success. Can anyone tell me what I
am doing wrong? I am not famliar with macros, and I do not understand the
macro below, therefore I am probably making some major mistakes.


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

ActiveDocument.Unprotect

ActiveDocument.Tables(1).Rows.Add

rownum = ActiveDocument.Tables(1).Rows.Count

For i = 1 To ActiveDocument.Tables(1).Columns.Count

ActiveDocument.FormFields.Add
Range:=ActiveDocument.Tables(1).Cell(rownum, i).Range,
Type:=wdFieldFormTextInput

Next i

ActiveDocument.Tables(1).Cell(ActiveDocument.Table s(1).Rows.Count,
ActiveDocument.Tables(1).Columns.Count).Range.Form Fields(1).ExitMacro =
"addrow"

ActiveDocument.Tables(1).Cell(ActiveDocument.Table s(1).Rows.Count,
1).Range.FormFields(1).Select

ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True




Thanks for any advise / guidance given,
LPS
  #2   Report Post  
Posted to microsoft.public.word.tables
Cindy M -WordMVP-
 
Posts: n/a
Default Repeating Rows with Form Fields

this duplicate question has received replies in the
vba.general newsgroup. Please do not post to multiple
groups!

Cindy Meister

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Word crashing upon re-use of a template jenwren Microsoft Word Help 5 August 24th 05 11:59 PM
cannot enter into form fields desperate secretary Microsoft Word Help 1 August 18th 05 05:46 AM
Why does text move around when typing in created form fields? jmbubble Microsoft Word Help 1 August 18th 05 12:01 AM
Using form text fields included in an IF Statement with autotext Steve Microsoft Word Help 7 April 8th 05 08:17 AM
Form fields in frames - can I format the text (ie bold, italic)? La La Lara Microsoft Word Help 3 January 28th 05 03:09 PM


All times are GMT +1. The time now is 04:22 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"