lanepoy.blogg.se

How to delete header and footer in word 2003
How to delete header and footer in word 2003









how to delete header and footer in word 2003
  1. #How to delete header and footer in word 2003 how to
  2. #How to delete header and footer in word 2003 manual
  3. #How to delete header and footer in word 2003 code

Then the code finds out how many paragraphs exist and loops backwards to create a string. The code first grabs all the document content and assigns it to a Range variable (rng). The key is the use of the Range object and all the document content. Private Sub EnumerateParagraphs()ĭim curDoc As Word.Document = WordApp.ActiveDocument This method loops through all the paragraphs in the active document and reverses their order in a new document. Just know that together, these two objects allow you to select and find Word content. I covered the selection object in this article so I will focus on the Range object. The quickest way to achieve this goal is to master the Range and the Selection objects.

The best way to figure out how to make things happen via code is to learn to think like Word thinks. The Word object model is extensive and more than a little complex. By the end of the samples, my hope is you will have a general idea of how to access and edit content within a Word document. I’ll start with the Range object and keep going as long as I have paper. I want to give you a lot of VB.NET code samples today. Accessing Word document content objects with code There are more “content” objects than these but the list above are the major objects that provide access to everything else. They contain ranges starting and ending character positions within the Word document. Perhaps its two most popular properties are Start and End. It contains a contiguous section of a document. Range :: Think of this object like real-estate.The insertion point is where the cursor blinks in the Word UI to inform the user of their location within the document. It also is the insertion point if no selection exists. Selection :: This object contains the content selected either by the user or via code.Confused? The code samples will help bring focus to the picture. This collection contains a collection of Range objects, which in turn, contain all the sentences for the Range. Instead, there is the Paragraphs collection object. Sentence :: This object does not exist… strange as that might seem.Don’t ponder over that last sentence too much, I will explain it further in my next article. Paragraphs also contain the formatting for content residing above it. A paragraph can reside within a Selection, Document, or Range and is accessible via the Paragraphs collection object. Paragraph :: A single paragraph of content.Page :: Represents a single page within a document.This is how you apply different formatting, layout, and header/footer options to a Word document… by creating sections and formatting them differently. Section :: Documents can contain multiple sections.I covered the document object in a previous article – Word application and base objects. It lives in an appropriately named collection called Documents. This is the parent object for all content within a Word document file. Document :: The document represents a single, solitary Word document.Repeat steps 6-8 for each page to have header / footer area suppressed.įor documents using direct formatting (e.g., Format > Page…) the same process should work, although to what degree, will depend on how the direct formatting has been applied and to what extent.Let’s look at the objects that combine together to construct a Word document.Press DEL (if required to remove carriage return or page break in front of cursor).

how to delete header and footer in word 2003

  • Insert > Manual Break… > Type of “Page Break” > Style of “No header / footer” > click OK.
  • Place the cursor at the end of the content on the page prior to the page to have no header / footer.
  • Organiser tab > give this new style a meaningful name (e.g., “No header / footer”) > set Next Style to “Default Style”.
  • Create a new page style based on the Default Style page style (right-click > New…).
  • If the Default Style page style has been used throughout a work and this style edited to display the header / footer area, then this process will work: I recommend referring to the Writer Guide v4.0 Working with page styles, pp.221-228.

    how to delete header and footer in word 2003

    There is no manner of suppressing header / footer areas on arbitrary pages without using page styles e.g., Format > Styles and Formatting > select Page Styles icon at top:











    How to delete header and footer in word 2003