Macro to delete section and update TOC and page numbers accordingl

S

Satya

Hi ,

I want to write a macro to remove a complete section in all respects( i.e
alongwith header footer heading etc), it will also
remove entries from TOC, also TOC & the document be updated for section
numbers and page numbers.

Any starting help on as how to do it would be appreciated.
Also what problems I may encounter in this scenario.

Thanks a lot
Satya
 
G

Greg Maxey

Something like:

Sub Scratchmacro()
Dim TOC As TableOfContents
Set TOC = ActiveDocument.TablesOfContents(1)
With ActiveDocument
.Sections(2).Range.Delete
TOC.Update
End With
End Sub

may get you started.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top