[]
        
(Showing Draft Content)

GrapeCity.Documents.Word.GcWordDocument

GcWordDocument Class

Represents a Word document.

Contains one or more sections, content controls, and body representing the content of the document.

Inheritance
GcWordDocument
Namespace: GrapeCity.Documents.Word
Assembly: DS.Documents.Word.dll
Syntax
public class GcWordDocument : DocumentBase
Public Class GcWordDocument
    Inherits DocumentBase

Constructors

Name Description
GcWordDocument(string)

Creates a new instance of the GcWordDocument class, optionally specifying a license key.

Properties

Name Description
Body

Gets the main body of the document.

CustomXmlParts

Gets the collection of CustomXmlPart objects.

DataTemplate

Gets the DataTemplate object that provides properties and methods used to manage template data sources and process data templates.

GlossaryDocument

Gets a supplementary document storage which stores the definition and content for content that shall be carried with the document for future insertion and/or use, but which shall not be visible within the contents of the main document story.

HideLinkedCharacterStyles

Gets or sets whether to hide linked character styles.

MalformedUriRewriter

Gets or sets the malformed URI rewriter that can be used to implement a custom strategy for rewriting malformed URIs.

By default this property is null (i.e. no rewriting takes place).

Set this to an instance of the DefaultMalformedUriRewriter class to use the default rewriting strategy, or use a custom IMalformedUriRewriter implementation.

Theme

Gets the theme that holds all formatting options available to a document through a theme.

Methods

Name Description
GetPropertyValueSource<T>(Expression<Func<T>>)

Gets the source of a formatting property.

This method finds and returns the object in the inheritance chain that determines the actual current value of the specified formatting property.

For example, to find the object that determines the font size of the first run in the document body:

var o = GetPropertyValueSource(() => document.Body.Runs.First.Font.Size);

In this example, if the Heading 1 style was applied to the paragraph containing that run, this method would return that style.

Load(Stream)

Loads a Stream that contains OpenXml formatted data into the document.

Load(string)

Loads an OpenXml formatted file into the document.

MergeDocuments(FormattingCopyStrategy, params GcWordDocument[])

Merges several source documents into a single new GcWordDocument.

MergeDocuments(params GcWordDocument[])

Merges several source documents into a single new GcWordDocument, using Copy to preserve formatting of the source documents.

MergeDocuments(params (GcWordDocument, FormattingCopyStrategy)[])

Merges several source documents into a single new GcWordDocument.

Save(Stream, DocumentType)

Saves the document to a Stream.

Save(string, DocumentType)

Saves the document to an OpenXml formatted file.

SetLicenseKey(string)

Sets the license key.

SplitDocument(FormattingCopyStrategy, params RangeBase[])

Splits the current document into several documents based on specified ranges and a common formatting copy strategy.

SplitDocument(params RangeBase[])

Splits the current document into several documents based on specified ranges, using Copy to preserve formatting of the source document.

SplitDocument(params (RangeBase splitRange, FormattingCopyStrategy copyStrategy)[])

Splits the current document into several documents based on specified ranges and formatting copy strategies.

UpdateFields(WordLayoutSettings)

Updates all fields in the document.

Extension Methods