OfficeIMO

API Reference

Class

WordHelpers

Namespace OfficeIMO.Word
Assembly OfficeIMO.Word

Provides helper methods for Word document manipulation.

Inheritance

  • Object
  • WordHelpers

Constructors

public WordHelpers() #

Methods

public static Void ConvertDotXtoDocX(String templatePath, String outputPath) #
Returns: Void

Converts a DOTX template to a DOCX document. Based on: https://github.com/onizet/html2openxml/wiki/Convert-.dotx-to-.docx

Parameters

templatePath System.String requiredposition: 0
The path to the DOTX template file.
outputPath System.String requiredposition: 1
The path where the converted DOCX file will be saved.
public static Int32 GetNextSdtId(WordDocument document) #
Returns: Int32

Provides the next available structured document tag identifier for the specified document. The allocator guarantees positive, unique identifiers within the document scope.

Parameters

document OfficeIMO.Word.WordDocument requiredposition: 0
Target document that owns the structured document tags.

Returns

A positive integer identifier that has not been used in the document.

Exceptions

  • ArgumentNullException – Thrown when document is null.
public static Void RemoveHeadersAndFooters(String filename, params HeaderFooterValues[] types) #
Returns: Void

Removes headers and footers from the file at filename. When no types are provided all headers and footers are removed.

Parameters

filename System.String requiredposition: 0
Path to the document.
types DocumentFormat.OpenXml.Wordprocessing.HeaderFooterValues[] requiredposition: 1
Header or footer types to remove.