Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with Macro in Word 97

Status
Not open for further replies.

jofarrell

Programmer
Mar 21, 2001
178
US
What I am trying to do seems like it should be easy but its making me crazy. I have a form created in Word 97. I want the users to be able to add a row in a table (three cells, first one with an input box, second and third with a check box) Is there a way I can create a macro that will copy ALL the contents of that table row and paste it when "Alt+R" is pressed? I have the add row part down pat .. its adding the other objects IN that row that are making me crazy ... anyone have any suggestions?

Thanks in advance

Joanne
 
Anyone have any suggestions at all or need more info?

Joanne
 
Jo,

I recorded the steps as I understood them from your post and cleaned up a little bit. I don't have 97 at home, so this works in Word 2000. If you record your steps in '97 you're likely to get enough information to adapt the below.
(I suspect the InsertRow method may be different, but then you already have that down.)

Sub Test()

With Selection
.HomeKey Unit:=wdRow
.InsertRowsBelow 1
.FormFields.Add Range:=Selection.Range, Type:= _
wdFieldFormTextInput
.MoveRight Unit:=wdCell
.FormFields.Add Range:=Selection.Range, Type:= _
wdFieldFormCheckBox
.MoveRight Unit:=wdCell
.FormFields.Add Range:=Selection.Range, Type:= _
wdFieldFormCheckBox
.HomeKey Unit:=wdRow
End With

End Sub

Good luck!

Ilses
 
Thank you so much, I will give that a try and see what happens :):)


Joanne
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top