Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #39  
Old 07-14-2011, 03:13 PM
macropod's Avatar
macropod macropod is offline Copy/Paste/Delete Table & Section etc. Windows 7 64bit Copy/Paste/Delete Table & Section etc. Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,371
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy/Paste/Delete Table & Section etc. 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/Paste/Delete Table & Section etc. Copy and paste special Dace Excel 2 02-16-2009 12:18 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:36 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft