P
p0
Hello,
I'm having a Word document containing several citation fields. I want
to remove all of those through VBA code:
Public Function DeleteCitations()
Dim fld As Field
For Each fld In Application.ActiveDocument.Fields
If fld.Type = wdFieldCitation Then
fld.Select
Selection.Delete
End If
Next
End Function
The Delete command is not working as for some reason the field is
locked. However, querying the 'Locked' property of the field shows me
that it is set to 'False'.
I noticed that when I add the citation through 'QuickParts' -> 'Field'
rather than through 'References' -> 'Insert citation', the field is
not locked and the Delete command can be executed without problem. So
it looks as if some special type of locking is done.
My current workaround is to do a Selection.Cut which solves the
problem put pollutes the clipboard.
Any idea on how to get rid of the strange lock? Or alternatively, is
there a way to store the current state of the clipboard, do the Cut
commands and then restore the clipboard?
Yves
I'm having a Word document containing several citation fields. I want
to remove all of those through VBA code:
Public Function DeleteCitations()
Dim fld As Field
For Each fld In Application.ActiveDocument.Fields
If fld.Type = wdFieldCitation Then
fld.Select
Selection.Delete
End If
Next
End Function
The Delete command is not working as for some reason the field is
locked. However, querying the 'Locked' property of the field shows me
that it is set to 'False'.
I noticed that when I add the citation through 'QuickParts' -> 'Field'
rather than through 'References' -> 'Insert citation', the field is
not locked and the Delete command can be executed without problem. So
it looks as if some special type of locking is done.
My current workaround is to do a Selection.Cut which solves the
problem put pollutes the clipboard.
Any idea on how to get rid of the strange lock? Or alternatively, is
there a way to store the current state of the clipboard, do the Cut
commands and then restore the clipboard?
Yves