Reply
 
Thread Tools Display Modes
  #1   Report Post  
mk1871
 
Posts: n/a
Default Add a reow to a table on a protected form

Is it possible to add a row to a table on a protected form in Word? If so,
how do I set up the form to allow this.
  #2   Report Post  
Doug Robbins
 
Posts: n/a
Default

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



End Sub

--
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
"mk1871" wrote in message
...
Is it possible to add a row to a table on a protected form in Word? If so,
how do I set up the form to allow this.



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
Protected Form - allow users to access hyperlink in the form Diddakoi Microsoft Word Help 1 August 5th 05 12:34 AM
Table AutoFormats vs. Table Styles confusion Tony Jollans Tables 5 March 6th 05 07:18 PM
Allowing calculations in a table in a protected form? Melissa Weiler Tables 1 February 21st 05 06:14 PM
Table Gridlines in Word 2003 Form Linda L Tables 1 January 5th 05 10:52 PM
Using VBA to Add Table Row to Form Table KLSiegel Tables 1 November 25th 04 03:26 AM


All times are GMT +1. The time now is 05:40 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"