Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2005

Tip: Looking for answers? Try searching our database.

Delete Section Break

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andy Newland - 17 Mar 2005 17:01 GMT
Hi all,

Does anyone know how I can delete a section break in code?

Andy
Greg - 17 Mar 2005 18:04 GMT
Andy,

The following deletes the section break immediately above the insertion
point.  You could easily adapt it to delete the one after.

Sub DeleteSectionBreak()
Dim i As Integer
Dim j As Integer
i = 1
j = Selection.Sections(1).Index
If i < ActiveDocument.Sections.Count Then
Selection.GoTo What:=wdGoToSection, Which:=wdGoToAbsolute, Count:=j
Selection.MoveLeft
Selection.Delete
End If
End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.