Click or drag to resize
DocumentModelLoad Method (String)
Loads a document from a file with the specified path.

Namespace: GemBox.Document
Assembly: GemBox.Document (in GemBox.Document.dll) Version: 25.3.30.1231
Syntax
public static DocumentModel Load(
	string path
)

Parameters

path
Type: SystemString
The path from which to load a document.

Return Value

Type: DocumentModel
A loaded document.
Exceptions
ExceptionCondition
InvalidOperationExceptionIf file extension is not specified or not supported. If file extension is not recognized, use Load(String, LoadOptions) method overload instead.
Remarks
File extension that is extracted from the path is used to create the appropriate LoadOptions derived class instance that is then passed to the Load(String, LoadOptions) method.

Following file extensions are supported:

  • Microsoft Word: .docx, .docm, .dotm, .dotx
  • Microsoft Word 97-2003: .doc, .dot
  • HyperText Markup Language: .htm, .html, .mht, .mhtml
  • Rich Text Format: .rtf
  • Portable Document Format: .pdf
  • Plain Text: .txt
See Also