[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [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
   [Expand]Document Loading
   [Collapse]Document Saving
     Standard and Custom Saving
     Auto-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]Localization
 [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]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Document Saving

DevExpress office controls provide general-purpose document saving capabilities. They are introduced to end-users through built-in UI commands and are available to developers through a public API.

In an application, a document save operation can be initiated in the following cases.

  • An end-user selects the Save or SaveAs command in the office control UI.
  • A developer calls the Save or SaveCopy methods of the public API. See the Standard and Custom Saving topic to learn more.
  • The AutoSave feature (which is off by default) triggers document saving after a specific period of time. Refer to the Auto-Saving topic for more information.

This topic describes the main UI commands and API members that relate to document saving.

Expanded UI Commands

To save a document, end-users can use the Save and SaveAs commands of the built-in ribbon, which is displayed in an office control by default.

Expanded API

The public API used to save documents is exposed at two levels - at the office control and the DocumentManager object level. The main API members are listed below.

Office Control Level

  • Save method
    Saves the currently edited document in its original format and location.

  • SaveCopy method overloads
    Each method overload saves a copy of the office control's currently edited document in a specific manner and does not affect the original document state. The syntaxes of the main overloads are given below.

    • void SaveCopy(string documentPath)
    • void SaveCopy(Stream stream, DocumentFormat format)
    • Byte[] SaveCopy(DocumentFormat format)

  • Saving event
    Enables you to handle document save operations in a custom manner and resolve multi-user conflicts, if any.

  • AutoSaveMode property
    Specifies whether to explicitly enable auto-saving of documents opened by this particular office control.

  • AutoSaveTimeout property
    Specifies a delay after which the next auto-save operation will be performed.

DocumentManager Level

  • SaveCopy method overloads (at the IDocumentInfo level)
    Each method overload saves a copy of this particular open document in a specific manner and does not affect the original document state. The syntaxes of the available overloads are given below.

    • void SaveCopy(string filePath)
    • void SaveCopy(Stream stream)
    • Byte[] SaveCopy()

  • AutoSaving event
    Enables you to handle document auto-save operations in a custom manner and resolve multi-user conflicts, if any.

Refer to the following topics to learn more on how to process document save operations.

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