N
Nick Calladine
Hi
I currently have a table in which i am populated each added row with a
dropdown box.
I have tried to record the following through the macro record and need two
point answering.
One is there a better coding way of doing this correctly.
Secondly i cant seem to get away of adding to each row cause of syntax of
selecting the last drop down thats it has added
I understand this take the index of the formfield
So i need to work it to so it either finds the maximum index of the
formfield and then minus 1 to get the last added formfield or a better in my
case a general piece which at time of adding select the formfield i just
added.
The formfield is exactly the same in every row.
Please can some one point me in the right direction and shed some light
Many thanks
Code Below -->
.FormFields.Add Range:=Selection.Range, Type:=wdFieldFormDropDown
Selection.PreviousField.Select
With Selection.FormFields(1)
.Name = "CIS"
.Enabled = True
.OwnHelp = False
.HelpText = ""
.OwnStatus = False
.StatusText = ""
End With
Selection.FormFields("CIS").DropDown.ListEntries.Clear
Selection.FormFields("CIS").DropDown.ListEntries.Add Name:="CIS 4"
Selection.FormFields("CIS").DropDown.ListEntries.Add Name:="CIS 6"
Selection.FormFields("CIS").DropDown.ListEntries.Add Name:="VAT"
Selection.FormFields("CIS").DropDown.ListEntries.Add Name:="None"
I currently have a table in which i am populated each added row with a
dropdown box.
I have tried to record the following through the macro record and need two
point answering.
One is there a better coding way of doing this correctly.
Secondly i cant seem to get away of adding to each row cause of syntax of
selecting the last drop down thats it has added
I understand this take the index of the formfield
So i need to work it to so it either finds the maximum index of the
formfield and then minus 1 to get the last added formfield or a better in my
case a general piece which at time of adding select the formfield i just
added.
The formfield is exactly the same in every row.
Please can some one point me in the right direction and shed some light
Many thanks
Code Below -->
.FormFields.Add Range:=Selection.Range, Type:=wdFieldFormDropDown
Selection.PreviousField.Select
With Selection.FormFields(1)
.Name = "CIS"
.Enabled = True
.OwnHelp = False
.HelpText = ""
.OwnStatus = False
.StatusText = ""
End With
Selection.FormFields("CIS").DropDown.ListEntries.Clear
Selection.FormFields("CIS").DropDown.ListEntries.Add Name:="CIS 4"
Selection.FormFields("CIS").DropDown.ListEntries.Add Name:="CIS 6"
Selection.FormFields("CIS").DropDown.ListEntries.Add Name:="VAT"
Selection.FormFields("CIS").DropDown.ListEntries.Add Name:="None"