This class is used to represent a region of the document that can be edited. This is the main class for manipulating the Word object model. Most elements of a Document inherit from the Element class.

public class Element
Public Class Element

You cannot create a new Element object by using the new keyword. There are various properties

The following sample demonstrates getting an Element object by retrieving a section's header:

          WordApplication app = new WordApplication();
          Document doc = app.Open(@"C:\sample.doc");
          Section sect = doc.Sections[0];
          Element e = sect.GetHeader(Section.HeaderFooterType.All);
        
          Dim app As New WordApplication()
          Dim doc As Document = app.Open("C:\sample.doc")
          Dim sect As Section = doc.Sections(0)
          Dim e As Element = sect.GetHeader(Section.HeaderFooterType.All)
        

Name

Description

Children

ElementType

Length

Start

Text

Name

Description

CreateBookmark(String)

CreateSectionAfter()

CreateSectionBefore()

DeleteElement()

GetElements(Element.Type)

GetPosition(Int32)

ImportData(Object()())

ImportData(Object()(), String(), DataImportProperties)

ImportData(System.Data.DataTable)

ImportData(System.Data.DataTable, DataImportProperties)

ImportData(System.Data.DataView)

ImportData(System.Data.DataView, DataImportProperties)

ImportData(Object(,))

ImportData(Object(,), String(), DataImportProperties)

ImportData(System.Data.IDataReader)

ImportData(System.Data.IDataReader, DataImportProperties)

InsertAfter(Element)

InsertBefore(Element)

InsertBreakAfter(Element.BreakType)

InsertBreakBefore(Element.BreakType)

InsertHyperlinkAfter(String, String)

InsertHyperlinkBefore(String, String)

InsertImageAfter(System.IO.Stream)

InsertImageAfter(String)

InsertImageBefore(String)

InsertImageBefore(System.IO.Stream)

InsertListAfter(Boolean)

InsertListBefore(Boolean)

InsertMergeFieldAfter(String, String)

InsertMergeFieldBefore(String, String)

InsertParagraphAfter(NamedStyle)

InsertParagraphAfter(NamedStyle, ParagraphFormatting)

InsertParagraphBefore(NamedStyle)

InsertParagraphBefore(NamedStyle, ParagraphFormatting)

InsertTableAfter(Int32, Int32)

InsertTableAfter(Int32, Int32, TableFormatting)

InsertTableBefore(Int32, Int32)

InsertTableBefore(Int32, Int32, TableFormatting)

InsertTextAfter(String, Boolean)

InsertTextAfter(String, Font)

InsertTextBefore(String, Boolean)

InsertTextBefore(String, Font)

Search(String)

SearchAndReplace(String, String)

SubElement(Int32, Int32)

Overload

Description

ImportData(Microsoft.SharePoint.SPList)

ImportData(Microsoft.SharePoint.SPView, Microsoft.SharePoint.SPList, DataImportProperties)

Name

Description

BreakType

Type