What I need to do is take a paragraph copy and paste it into a new file, save that file and then have it automatically do the same for the next paragraph. The code I have does this once. However, my document is 250 pages long with over 300 paragrpahs so I need this to automatically loop. Here is my code so far:
Sub clicktest()
'
' clicktest Macro
'
'
Selection.MoveDown Unit:=wdParagraph, Count:=34, Extend:=wdExtend
Selection.MoveDown Unit:=wdLine, Count:=2, Extend:=wdExtend
Selection.Copy
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveDown Unit:=wdLine, Count:=37
Documents.Add DocumentType:=wdNewBlankDocument
Selection.PasteAndFormat (wdFormatOriginalFormatting)
Dim PathAndFileName As String, n As Long
PathAndFileName = "\\r04brxnas20\VHABRXOSTROR$\Trace"
If Dir(PathAndFileName & ".txt") = "" Then
ActiveDocument.SaveAs (PathAndFileName & ".txt"), FileFormat:=wdFormatText
Else
n = 1
Do While Dir(PathAndFileName & n & ".txt") <> ""
n = n + 1
Loop
ActiveDocument.SaveAs PathAndFileName & n & ".txt"
End If
End Sub
The problem I'm having is to loop this and have the active document be the original so it selects the right paragraph automatically.