---
title: "documentForFileName:"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsdocumentcontroller/documentforfilename:"
---

# documentForFileName:

Returns the document object for the file in which the document data is stored.

## Declaration

```occ
- (id) documentForFileName:(NSString *) fileName;
```

## Discussion

Discussion The fileName argument is a fully qualified path in the file system. Returns nil if no document can be found.

## See Also

### Deprecated Methods

- [fileExtensionsFromType:](appkit/nsdocumentcontroller/fileextensionsfromtype:.md)
- [fileNamesFromRunningOpenPanel](appkit/nsdocumentcontroller/filenamesfromrunningopenpanel.md)
- [makeUntitledDocumentOfType:](appkit/nsdocumentcontroller/makeuntitleddocumentoftype:.md)
- [makeDocumentWithContentsOfURL:ofType:](appkit/nsdocumentcontroller/makedocumentwithcontentsofurl:oftype:.md)
- [makeDocumentWithContentsOfFile:ofType:](appkit/nsdocumentcontroller/makedocumentwithcontentsoffile:oftype:.md)
- [openDocumentWithContentsOfFile:display:](appkit/nsdocumentcontroller/opendocumentwithcontentsoffile:display:.md)
- [openDocumentWithContentsOfURL:display:](appkit/nsdocumentcontroller/opendocumentwithcontentsofurl:display:.md)
- [openDocumentWithContentsOfURL:display:error:](appkit/nsdocumentcontroller/opendocumentwithcontentsofurl:display:error:.md)
- [openUntitledDocumentOfType:display:](appkit/nsdocumentcontroller/openuntitleddocumentoftype:display:.md)
- [reopenDocumentForURL:withContentsOfURL:error:](appkit/nsdocumentcontroller/reopendocumentforurl:withcontentsofurl:error:.md)
- [setShouldCreateUI:](appkit/nsdocumentcontroller/setshouldcreateui:.md)
- [shouldCreateUI](appkit/nsdocumentcontroller/shouldcreateui.md)
- [typeFromFileExtension:](appkit/nsdocumentcontroller/typefromfileextension:.md)
