rachitm
Thu Nov 30 13:57:37 CST 2006
I didnt realize till today, but when you press the button to copy paste
the table the 2nd time, it erases the info off the table that was
created when the button was pressed the 1st time. What could be done
about that?
Also, is there a way to create space between all the pasted tables?
That could be one way of solving this problem.
Thanks
rachitm@gmail.com wrote:
> This is awesome Jean! this is perfect! thank you so much for your help
> :)
>
>
>
> Jean-Guy Marcil wrote:
> > rachitm@gmail.com was telling us:
> > rachitm@gmail.com nous racontait que :
> >
> > > Thanks Jean! This does work to some extent. But I have a table which
> > > has formfields and some info inside other cells that I still need to
> > > be copied into the new table....Bascically I just need formfields
> > > (empty) to be copied...as some cell info.
> > >
> > > eg.
> > >
> > > heading 1 I <formfield> I
> > > heading 2 I <formfield> I
> > > heading 3 I <formfield> I
> > > heading 4 I <formfield> I
> > >
> > > I want all the headings to be copied and the formfields to be copied,
> > > but the formfields should be empty.
> >
> > Try this then (This assumes that your formfields have a default value and
> > that the first item in a dropdown is not an actual choice, but something
> > like "Select please"...):
> >
> > '_______________________________________
> > Dim aDoc As Document
> > Dim myRange As Range
> > Dim ffToReset As FormFields
> > Dim i As Long
> >
> > Set aDoc = ActiveDocument
> > With aDoc
> > If .ProtectionType <> wdNoProtection Then
> > .Unprotect
> > .Tables(2).Range.Copy
> > Set myRange = .Range(Start:=.Content.End - 1, _
> > End:=.Content.End - 1)
> > myRange.PasteSpecial
> > Set myRange = .Tables(.Tables.Count).Range
> > aDoc.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
> > With myRange
> > Set ffToReset = .FormFields
> > If ffToReset.Count > 0 Then
> > For i = 1 To ffToReset.Count
> > Select Case ffToReset(i).Type
> > Case wdFieldFormTextInput
> > ffToReset(i).Result =
> > ffToReset(i).TextInput.Default
> > Case wdFieldFormCheckBox
> > ffToReset(i).CheckBox.Value = False
> > Case wdFieldFormDropDown
> > ffToReset(i).DropDown.Value = 1
> > End Select
> > Next
> > End If
> > End With
> > End If
> > End With
> > '_______________________________________
> >
> > Please, try to be more explicit next time...
> >
> > --
> >
> > Salut!
> > _______________________________________
> > Jean-Guy Marcil - Word MVP
> > jmarcilREMOVE@CAPSsympatico.caTHISTOO
> > Word MVP site:
http://www.word.mvps.org