Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
Jamie Jamie is offline
external usenet poster
 
Posts: 45
Default Maintain Form Field Format

I am working in Word 2003.

I have a table; 5 columns, 2 rows. The first row consists of column
headings, the second row contains form fields in each column. I have an on
exit macro on the last form field that creates a new row with form fields in
each column. Two of the form fields are dates with the format of MMMM d,
yyyy. The new fields do not maintain this date format. Is there a way to
copy the formats of the form fields? Here is my coding:

Sub AddRow()

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

Thanks!
--
Jamie
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
How do I maintain format of labels to a second page? R0berta Microsoft Word Help 2 February 1st 06 07:02 AM
how do i maintain the format with mail merge SJ Mailmerge 1 November 20th 05 12:43 PM
Maintain table format after update Ben Microsoft Word Help 0 September 13th 05 09:46 AM
Maintain table format after update Ben Tables 0 September 12th 05 09:16 AM
Maintain table format after update Ben Microsoft Word Help 0 August 31st 05 03:50 PM


All times are GMT +1. The time now is 03:55 AM.

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"