O
Owen
Hi
I am looking to write a macro that tests the cursor position within a
document. Where the IF statement is true, then i would like to be able to
delete the current row in a table.
Where the IF statement is false, then i would like nothing further to occur.
I am basically giving the user the ability to delete a row within a form,
but want to protect specific rows from deletion.
I have attempted the code below, however there is a problem with the first
line
If ActiveDocument.Tables(12).Rows(2) Then
ActiveDocument.Protect (wdAllowOnlyFormFields), Password:="ngo999",
NoReset:=True
Else
Selection.SelectRow
Selection.Rows.Delete
ActiveDocument.Protect (wdAllowOnlyFormFields), Password:="ngo999",
NoReset:=True
Any help would be greatly appreciated.
I am looking to write a macro that tests the cursor position within a
document. Where the IF statement is true, then i would like to be able to
delete the current row in a table.
Where the IF statement is false, then i would like nothing further to occur.
I am basically giving the user the ability to delete a row within a form,
but want to protect specific rows from deletion.
I have attempted the code below, however there is a problem with the first
line
If ActiveDocument.Tables(12).Rows(2) Then
ActiveDocument.Protect (wdAllowOnlyFormFields), Password:="ngo999",
NoReset:=True
Else
Selection.SelectRow
Selection.Rows.Delete
ActiveDocument.Protect (wdAllowOnlyFormFields), Password:="ngo999",
NoReset:=True
Any help would be greatly appreciated.