[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]What's Installed
 [Collapse]Common Concepts
  [Expand]Web.config Modifications
  [Expand]Callback Exception Handling
  [Expand]Client-Side Functionality
  [Expand]Cookies Support
  [Expand]Appearance Customization - Theming
   Icon Collection
  [Expand]Performance Optimization
  [Expand]CSS Image Sprites
   Supported Document Types
  [Expand]Accessibility Support
   Right to Left Support
   HTML Encoding
   Binary Storage Configuration
  [Expand]SharePoint Support
   Mobile Support
  [Collapse]Office Document Management
   [Collapse]Document Loading
     Opening Documents
     Sharing Documents
   [Expand]Document Saving
    Document Hibernation
   Cloud Storage Account Management
  [Expand]Web Farm and Web Garden Support
 [Expand]ASP.NET WebForms Controls
 [Expand]ASP.NET MVC Extensions
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Document Loading

To start working with DevExpress office controls and use their extended document editing capabilities, load a document into the control. A document can be loaded into an office control in one of the following ways.

  • By default, a control is initialized with the automatically generated document (if no document is opened explicitly by code).
  • A new document can be created explicitly in one of the following ways:
    • via the UI (using the built-in ribbon’s New command)
    • through public API (using the control level's New method)
  • You can open an existing document via one of the approaches below:
    • through the UI (using the ribbon's Open command)
    • through public API (using the control level's Open methods)

Expanded UI Commands

To load a document, end-users can use the built-in ribbon’s New or Open commands, which is displayed in an office control by default.

The availability of the New, Open, Save and Save As ribbon commands in the document management UI is based on the concept of using the server's local file system as a document storage and defining an office control's WorkDirectory property to specify the root server folder for all document operations (such as opening or saving). In this case, all built-in File Dialogs are available for end-users by default – allowing users to navigate through files and folders within the specified folder and select documents to load or save.

If you use a custom document storage that is not based on the server file system (for instance, a database), hide the built-in ribbon's File tab and implement your custom UI for opening and saving documents, because the WorkDirectory and built-in document management ribbon commands are not in effect in this case.

Expanded API

The public API used to create and open documents is exposed at the level of the office control. The main API members are listed below.

Office Control Level

  • New method
    Creates a new empty document within an office control.
    Note that the DocumentId is empty for a new document, so it cannot be accessed from a list of opened documents maintained by DocumentManager. You need to specify a unique DocumentId for newly created documents, or they will be completely lost when an end-user switches to another document (e.g., when creating another document or opening existing one).

  • Open method overloads
    An office control opens a document specified by the method's parameters.
    Note that certain Open methods (which open a document from the server file system) set the document's DocumentId automatically; the others require you to specify it manually.

Refer to the following topics to learn more on how to open documents within DevExpress office controls.

Is this topic helpful?​​​​​​​