Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Description

Excerpt

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.

Signature
C#
C#
<p> public class Element</p>
Signature
vb.net
vb.net
<p>Public Class Element</p>
Remarks

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:

Example
Code Block
csharp
csharp
titleC#

          WordApplication app = new WordApplication();
          Document doc = app.Open(@"C:\sample.doc");
          Section sect = doc.Sections[0];
          Element e = sect.GetHeader(Section.HeaderFooterType.All);
        
Code Block
vb.net
vb.net
titlevb.net

          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)
        
Properties

Name

Description

Children

Excerpt Include
Element.Children
Element.Children
nopaneltrue

ElementType

Excerpt Include
Element.ElementType
Element.ElementType
nopaneltrue

Length

Excerpt Include
Element.Length
Element.Length
nopaneltrue

Start

Excerpt Include
Element.Start
Element.Start
nopaneltrue

Text

Excerpt Include
Element.Text
Element.Text
nopaneltrue
Methods

Name

Description

CreateBookmark(String)

Excerpt Include
Element.CreateBookmark(String)
Element.CreateBookmark(String)
nopaneltrue

CreateSectionAfter()

Excerpt Include
Element.CreateSectionAfter()
Element.CreateSectionAfter()
nopaneltrue

CreateSectionBefore()

Excerpt Include
Element.CreateSectionBefore()
Element.CreateSectionBefore()
nopaneltrue

DeleteElement()

Excerpt Include
Element.DeleteElement()
Element.DeleteElement()
nopaneltrue

GetElements(Element.Type)

Excerpt Include
Element.GetElements(Element.Type)
Element.GetElements(Element.Type)
nopaneltrue

GetPosition(Int32)

Excerpt Include
Element.GetPosition(Int32)
Element.GetPosition(Int32)
nopaneltrue

ImportData(Object()())

Excerpt Include
Element.ImportData(Object()())
Element.ImportData(Object()())
nopaneltrue

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

Excerpt Include
Element.ImportData(Object()(), String(), DataImportProperties)
Element.ImportData(Object()(), String(), DataImportProperties)
nopaneltrue

ImportData(System.Data.DataTable)

Excerpt Include
Element.ImportData(System.Data.DataTable)
Element.ImportData(System.Data.DataTable)
nopaneltrue

ImportData(System.Data.DataTable, DataImportProperties)

Excerpt Include
Element.ImportData(System.Data.DataTable, DataImportProperties)
Element.ImportData(System.Data.DataTable, DataImportProperties)
nopaneltrue

ImportData(System.Data.DataView)

Excerpt Include
Element.ImportData(System.Data.DataView)
Element.ImportData(System.Data.DataView)
nopaneltrue

ImportData(System.Data.DataView, DataImportProperties)

Excerpt Include
Element.ImportData(System.Data.DataView, DataImportProperties)
Element.ImportData(System.Data.DataView, DataImportProperties)
nopaneltrue

ImportData(Object(,))

Excerpt Include
Element.ImportData(Object(,))
Element.ImportData(Object(,))
nopaneltrue

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

Excerpt Include
Element.ImportData(Object(,), String(), DataImportProperties)
Element.ImportData(Object(,), String(), DataImportProperties)
nopaneltrue

ImportData(System.Data.IDataReader)

Excerpt Include
Element.ImportData(System.Data.IDataReader)
Element.ImportData(System.Data.IDataReader)
nopaneltrue

ImportData(System.Data.IDataReader, DataImportProperties)

Excerpt Include
Element.ImportData(System.Data.IDataReader, DataImportProperties)
Element.ImportData(System.Data.IDataReader, DataImportProperties)
nopaneltrue

InsertAfter(Element)

Excerpt Include
Element.InsertAfter(Element)
Element.InsertAfter(Element)
nopaneltrue

InsertBefore(Element)

Excerpt Include
Element.InsertBefore(Element)
Element.InsertBefore(Element)
nopaneltrue

InsertBreakAfter(Element.BreakType)

Excerpt Include
Element.InsertBreakAfter(Element.BreakType)
Element.InsertBreakAfter(Element.BreakType)
nopaneltrue

InsertBreakBefore(Element.BreakType)

Excerpt Include
Element.InsertBreakBefore(Element.BreakType)
Element.InsertBreakBefore(Element.BreakType)
nopaneltrue

InsertHyperlinkAfter(String, String)

Excerpt Include
Element.InsertHyperlinkAfter(String, String)
Element.InsertHyperlinkAfter(String, String)
nopaneltrue

InsertHyperlinkBefore(String, String)

Excerpt Include
Element.InsertHyperlinkBefore(String, String)
Element.InsertHyperlinkBefore(String, String)
nopaneltrue

InsertImageAfter(System.IO.Stream)

Excerpt Include
Element.InsertImageAfter(System.IO.Stream)
Element.InsertImageAfter(System.IO.Stream)
nopaneltrue

InsertImageAfter(String)

Excerpt Include
Element.InsertImageAfter(String)
Element.InsertImageAfter(String)
nopaneltrue

InsertImageBefore(String)

Excerpt Include
Element.InsertImageBefore(String)
Element.InsertImageBefore(String)
nopaneltrue

InsertImageBefore(System.IO.Stream)

Excerpt Include
Element.InsertImageBefore(System.IO.Stream)
Element.InsertImageBefore(System.IO.Stream)
nopaneltrue

InsertListAfter(Boolean)

Excerpt Include
Element.InsertListAfter(Boolean)
Element.InsertListAfter(Boolean)
nopaneltrue

InsertListBefore(Boolean)

Excerpt Include
Element.InsertListBefore(Boolean)
Element.InsertListBefore(Boolean)
nopaneltrue

InsertMergeFieldAfter(String, String)

Excerpt Include
Element.InsertMergeFieldAfter(String, String)
Element.InsertMergeFieldAfter(String, String)
nopaneltrue

InsertMergeFieldBefore(String, String)

Excerpt Include
Element.InsertMergeFieldBefore(String, String)
Element.InsertMergeFieldBefore(String, String)
nopaneltrue

InsertParagraphAfter(NamedStyle)

Excerpt Include
Element.InsertParagraphAfter(NamedStyle)
Element.InsertParagraphAfter(NamedStyle)
nopaneltrue

InsertParagraphAfter(NamedStyle, ParagraphFormatting)

Excerpt Include
Element.InsertParagraphAfter(NamedStyle, ParagraphFormatting)
Element.InsertParagraphAfter(NamedStyle, ParagraphFormatting)
nopaneltrue

InsertParagraphBefore(NamedStyle)

Excerpt Include
Element.InsertParagraphBefore(NamedStyle)
Element.InsertParagraphBefore(NamedStyle)
nopaneltrue

InsertParagraphBefore(NamedStyle, ParagraphFormatting)

Excerpt Include
Element.InsertParagraphBefore(NamedStyle, ParagraphFormatting)
Element.InsertParagraphBefore(NamedStyle, ParagraphFormatting)
nopaneltrue

InsertTableAfter(Int32, Int32)

Excerpt Include
Element.InsertTableAfter(Int32, Int32)
Element.InsertTableAfter(Int32, Int32)
nopaneltrue

InsertTableAfter(Int32, Int32, TableFormatting)

Excerpt Include
Element.InsertTableAfter(Int32, Int32, TableFormatting)
Element.InsertTableAfter(Int32, Int32, TableFormatting)
nopaneltrue

InsertTableBefore(Int32, Int32)

Excerpt Include
Element.InsertTableBefore(Int32, Int32)
Element.InsertTableBefore(Int32, Int32)
nopaneltrue

InsertTableBefore(Int32, Int32, TableFormatting)

Excerpt Include
Element.InsertTableBefore(Int32, Int32, TableFormatting)
Element.InsertTableBefore(Int32, Int32, TableFormatting)
nopaneltrue

InsertTextAfter(String, Boolean)

Excerpt Include
Element.InsertTextAfter(String, Boolean)
Element.InsertTextAfter(String, Boolean)
nopaneltrue

InsertTextAfter(String, Font)

Excerpt Include
Element.InsertTextAfter(String, Font)
Element.InsertTextAfter(String, Font)
nopaneltrue

InsertTextBefore(String, Boolean)

Excerpt Include
Element.InsertTextBefore(String, Boolean)
Element.InsertTextBefore(String, Boolean)
nopaneltrue

InsertTextBefore(String, Font)

Excerpt Include
Element.InsertTextBefore(String, Font)
Element.InsertTextBefore(String, Font)
nopaneltrue

Search(String)

Excerpt Include
Element.Search(String)
Element.Search(String)
nopaneltrue

SearchAndReplace(String, String)

Excerpt Include
Element.SearchAndReplace(String, String)
Element.SearchAndReplace(String, String)
nopaneltrue

SubElement(Int32, Int32)

Excerpt Include
Element.SubElement(Int32, Int32)
Element.SubElement(Int32, Int32)
nopaneltrue
Extensionmethods
Introducedin
4.5
4.5

Overload

Description

ImportData(Microsoft.SharePoint.SPList)

Excerpt Include
SharePointIntegration.ImportData(Element, Microsoft.SharePoint.SPList)
SharePointIntegration.ImportData(Element, Microsoft.SharePoint.SPList)
nopaneltrue

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

Excerpt Include
SharePointIntegration.ImportData(Element, Microsoft.SharePoint.SPView, Microsoft.SharePoint.SPList, DataImportProperties)
SharePointIntegration.ImportData(Element, Microsoft.SharePoint.SPView, Microsoft.SharePoint.SPList, DataImportProperties)
nopaneltrue
Classes

Name

Description

BreakType

Excerpt Include
Element.BreakType
Element.BreakType
nopaneltrue

Type

Excerpt Include
Element.Type
Element.Type
nopaneltrue