samallred
04-14-2008, 11:02 AM
I don't think this is possible from my perspective and what I have tried to do. I have a word table with form fields in it. The user can click a button and get a copy of the table just fine. The problem I am having is that the copied table needs to have its form fields cleared out.
When I try to use the protect/unprotect of the document it will clear the data if I set NoReset to False or it will leave the data if I set NoReset to True.
All I want to do is reset the form fields on the table I am pasting below the original table.
Any ideas?
Here's what I have presently which I use to copy the table:
If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect
End If
Dim r As Range
Set r = ActiveDocument.Bookmarks("itemTable").Range
r.Copy
Selection.EndKey Unit:=wdStory, Extend:=wdMove
Selection.InsertBreak Type:=wdSectionBreakNextPage
Selection.Paste
Set r = Nothing
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
After pasting or before pasting, how can I reset the form fields?
Thanks.
VBA Tags added. Select your code and hit the VBA button when posting to format your code in the forum.
When I try to use the protect/unprotect of the document it will clear the data if I set NoReset to False or it will leave the data if I set NoReset to True.
All I want to do is reset the form fields on the table I am pasting below the original table.
Any ideas?
Here's what I have presently which I use to copy the table:
If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect
End If
Dim r As Range
Set r = ActiveDocument.Bookmarks("itemTable").Range
r.Copy
Selection.EndKey Unit:=wdStory, Extend:=wdMove
Selection.InsertBreak Type:=wdSectionBreakNextPage
Selection.Paste
Set r = Nothing
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
After pasting or before pasting, how can I reset the form fields?
Thanks.
VBA Tags added. Select your code and hit the VBA button when posting to format your code in the forum.