R
rachitm
I have figured out a way to copy paste a table (with fieldforms). I
have a macro button in my doc. which when I press copies the table in
the doc. and pastes it. The code to do the that is below:
Private Sub CommandButton1_Click()
Set aDoc = ActiveDocument
If aDoc.ProtectionType <> wdNoProtection Then
aDoc.Unprotect
ActiveDocument.Tables(2).Range.Copy
Set myRange = ActiveDocument.Range _
(Start:=ActiveDocument.Content.End - 1, _
End:=ActiveDocument.Content.End - 1)
myRange.PasteSpecial
aDoc.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End If
End Sub
Now, when the user fills in data in the table cells and then presses
the macro button, the pasted table has the same data in its cells. Is
there a way I could make sure that only the table is copy-pasted and
not the data inside it?
Any help would be great! Thank You
have a macro button in my doc. which when I press copies the table in
the doc. and pastes it. The code to do the that is below:
Private Sub CommandButton1_Click()
Set aDoc = ActiveDocument
If aDoc.ProtectionType <> wdNoProtection Then
aDoc.Unprotect
ActiveDocument.Tables(2).Range.Copy
Set myRange = ActiveDocument.Range _
(Start:=ActiveDocument.Content.End - 1, _
End:=ActiveDocument.Content.End - 1)
myRange.PasteSpecial
aDoc.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End If
End Sub
Now, when the user fills in data in the table cells and then presses
the macro button, the pasted table has the same data in its cells. Is
there a way I could make sure that only the table is copy-pasted and
not the data inside it?
Any help would be great! Thank You