KnownFolders.DocumentsLibrary Property

Definition

Gets the Documents library. The Documents library is not intended for general use.

public:
 static property StorageFolder ^ DocumentsLibrary { StorageFolder ^ get(); };
static StorageFolder DocumentsLibrary();
public static StorageFolder DocumentsLibrary { get; }
var storageFolder = KnownFolders.documentsLibrary;
Public Shared ReadOnly Property DocumentsLibrary As StorageFolder

Property Value

The Documents library.

Windows requirements

App capabilities
documentsLibrary

Remarks

Important

The Documents library is not intended for general use. For more info, see App capability declarations.

If your app has to create and update files that only your app uses, consider using the app's LocalCache folder. For more information on which folders you should use for your app's data, see ApplicationData class.

Alternatively, let the user select the file location by using a file picker. For more info, see Open files and folders with a picker and in particular the SuggestedStartLocation property which can be set to DocumentsLibrary. If the user selects the Documents Library from within the picker, you do not need to use this property nor do you need the documentsLibrary capability.

Prerequisites

To access the Documents library without using a picker, do the following things.

  • In the app manifest, specify the Documents Library capability. This capability is not visible in Manifest Designer. To add the Documents Library capability, open the app manifest in code view and edit the XML directly. You do not need this capability if you use the file pickers.
  • In the app manifest, register at least one File Type Association declaration. This declaration explicitly indicates the file types (extensions) that your app wants to access in the Documents library. The app can only enumerate, create, or change files that have the file types declared in the app manifest. For more info, see Handle file activation. You do not need to add this declaration if you use the file pickers.

Return value

To work with the Documents library and its contents, call the methods and properties of the StorageFolder class. For general info about how to use files and folders, see Enumerate and query files and folders.

Applies to