![]() |
|
#39
|
||||
|
||||
|
Hi flds,
Change: SubSctn As Section to: i As Long and replace everything between: 'Check for Design Requirements in the source document and: 'String variable for the output filenames with: Code:
For Each Sctn In .Sections
If InStr(UCase(Sctn.Range.Sentences.First), "DESIGN REQUIREMENT") > 0 Then
Set Rng = Sctn.Range
'Delete anything after the first 'Design Requirements' Section that isn't
'also a 'Design Requirements' Section
Rng.End = .Range.End
For i = Rng.Sections.Count To 2 Step -1
If InStr(UCase(Rng.Sections(i).Range.Sentences.First), "DESIGN REQUIREMENT") = 0 Then _
Rng.Sections(i).Range.Delete
Next
'Cut the 'Design Requirement' Sections from the source document
'and paste them into a new design requirements document
Rng.Cut
Set DocDesReq = Documents.Add(Visible:=False)
'Process the new document
Call NewDoc(DocDesReq)
Exit For
End If
Next Sctn
Call Cleanup(.Range)
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] Last edited by macropod; 07-14-2011 at 03:17 PM. Reason: Code refinements |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
copy and paste not working
|
Ellie | Word | 3 | 11-07-2013 02:23 PM |
| Can't copy paste | irenasobolewska | Office | 2 | 10-26-2012 05:09 PM |
| Copy - Paste between 2 tables | rod147 | Excel | 1 | 10-22-2009 08:21 PM |
| Copy & paste low resolution | worriedme | Drawing and Graphics | 0 | 06-01-2009 03:05 AM |
Copy and paste special
|
Dace | Excel | 2 | 02-16-2009 12:18 PM |