So I am trying to use code to create a table in word.
So far I have managed to insert a table of variable rows and columns depending on values of x,y. This table is placed into a specified bookmark and then the bookmark is replaced after the table so that another table if required can be enetered.
Once the table is positioned I want to be able to insert formfields into each cell. The selection is in cell one so by cycling the selection to the right one step it will move to the next cell.
I want to be able to write a loop that cycles one step at a time and inserts a formfield in each cell.
x*y will give the number of cells hence number of cycles.
so i = 1 is the first case no movement of selection needed so i can use the code
Selection.FormFields.Add Range:=Selection.Range, Type:= _
wdFieldFormTextInput
to insert a formfield into cell 1
So i need to write the case for i+1 to n
where n= x*y
could someone please point me in teh right direction
thanks
So far I have managed to insert a table of variable rows and columns depending on values of x,y. This table is placed into a specified bookmark and then the bookmark is replaced after the table so that another table if required can be enetered.
Once the table is positioned I want to be able to insert formfields into each cell. The selection is in cell one so by cycling the selection to the right one step it will move to the next cell.
I want to be able to write a loop that cycles one step at a time and inserts a formfield in each cell.
x*y will give the number of cells hence number of cycles.
so i = 1 is the first case no movement of selection needed so i can use the code
Selection.FormFields.Add Range:=Selection.Range, Type:= _
wdFieldFormTextInput
to insert a formfield into cell 1
So i need to write the case for i+1 to n
where n= x*y
could someone please point me in teh right direction

thanks