Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2006

Tip: Looking for answers? Try searching our database.

Problem formfields in table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jbc - 26 Oct 2006 21:01 GMT
Hello,

I'm working with a form that is made up of several tables.  The table has
several formfields.  The user goes thru them and is prompted to add another
item. The macro adds a new row and creates new formfields.  See code below:

The problem that I'm having is when I go to type in the first newly created
formfield.  Word is not accepting the first character.  What am I doing
wrong?   I've played around with different ways of selecting the cell and am
at a loss.

Thanks.

jbc

Sub AddNew1()

Dim ff As FormField
Dim intResponse As Integer

intResponse = MsgBox("Add Another Option?", vbYesNo, "Please Make a
Selection")
 
If intResponse = vbYes Then

  ActiveDocument.Unprotect
     
  'Remove Exit Macro From Last Cell in Row
  Selection.GoTo what:=wdGoToBookmark, Name:="LastFormField1"
   
  With Selection.FormFields(1)
     .ExitMacro = ""
  End With
     
 
  Selection.Tables(1).Rows.Add
  Selection.MoveRight Unit:=wdCell, Count:=4
 
  'Document Number
  Set ff = ActiveDocument.FormFields.Add _
  (Range:=Selection.Range, Type:=wdFieldFormTextInput)
 
     With ff
        .Name = "TypeHere1"
        .OwnStatus = True
        .StatusText = "Type Document Number"
     End With
     
  Selection.MoveRight Unit:=wdCell
 
  Set ff = ActiveDocument.FormFields.Add _
  (Range:=Selection.Range, Type:=wdFieldFormTextInput)
     
     With ff
        .OwnStatus = True
        .StatusText = "Type Code"
     End With
     
     Selection.MoveRight Unit:=wdCell
     
     Set ff = ActiveDocument.FormFields.Add _
     (Range:=Selection.Range, Type:=wdFieldFormTextInput)
 
     With ff
        .OwnStatus = True
        .StatusText = "Type Name"
     End With
 
 
     Selection.MoveRight Unit:=wdCell
     
     Set ff = ActiveDocument.FormFields.Add _
     (Range:=Selection.Range, Type:=wdFieldFormTextInput)
 
     With ff
        .OwnStatus = True
        .StatusText = _
           "Type Date, If No Date, Type 'Issued' Date, xx/xx/xx"
        .TextInput.EditType Type:=wdDateText, Format:="MM-dd-YYYY"
     End With
     
   
    Selection.MoveRight Unit:=wdCell

     Set ff = ActiveDocument.FormFields.Add _
     (Range:=Selection.Range, Type:=wdFieldFormTextInput)
 
     With ff
        .Name = "LastFormField1"
        .ExitMacro = "AddNew1"
        .OwnStatus = True
        .StatusText = "Type Requested Information"
     End With

ActiveDocument.Bookmarks("TypeHere1").Range.Fields(1).Result.Select
ActiveDocument.Protect wdAllowOnlyFormFields, noReset:=True

End If
jbc - 28 Oct 2006 01:46 GMT
Please don't reply....I figured it out.

> Hello,
>
[quoted text clipped - 94 lines]
>
> End If

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.