-
Try this.
[vba]
Option Explicit
Sub Macro1()
Dim i As Long
Dim Doc As Document
Dim NewDoc As Document
Dim SelectedText As Collection
Dim Temp As String
Set Doc = ActiveDocument
Set SelectedText = New Collection
For i = 1 To Doc.FormFields.Count
With Doc.FormFields(i)
If .Type = wdFieldFormCheckBox Then
If .CheckBox.Value = True Then
Temp = Selection.Tables(1).Cell(i, 2).Range.Text & vbTab & _
Selection.Tables(1).Cell(i, 3).Range.Text & vbTab & _
Selection.Tables(1).Cell(i, 4).Range.Text
Temp = Replace(Temp, Chr(7), "")
Temp = Replace(Temp, Chr(13), "")
SelectedText.Add Temp
End If
End If
End With
Next i
If SelectedText.Count > 0 Then
Set NewDoc = Documents.Add
NewDoc.Activate
For i = 1 To SelectedText.Count
Selection.TypeText Text:=SelectedText(i)
Selection.TypeParagraph
Next i
End If
End Sub
[/vba]
Refer to the attachment for more information.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules