---
title: NSAttributedString.DocumentType
framework: foundation
role: symbol
role_heading: Structure
path: foundation/nsattributedstring/documenttype
---

# NSAttributedString.DocumentType

Constants for the document type document attribute key.

## Declaration

```swift
struct DocumentType
```

## Overview

Overview Use these constants as values for the documentType key in the document attributes dictionary.

## Topics

### Getting keys for document types

- [docFormat](foundation/nsattributedstring/documenttype/docformat.md)
- [html](foundation/nsattributedstring/documenttype/html.md)
- [macSimpleText](foundation/nsattributedstring/documenttype/macsimpletext.md)
- [officeOpenXML](foundation/nsattributedstring/documenttype/officeopenxml.md)
- [openDocument](foundation/nsattributedstring/documenttype/opendocument.md)
- [plain](foundation/nsattributedstring/documenttype/plain.md)
- [rtf](foundation/nsattributedstring/documenttype/rtf.md)
- [rtfd](foundation/nsattributedstring/documenttype/rtfd.md)
- [webArchive](foundation/nsattributedstring/documenttype/webarchive.md)
- [wordML](foundation/nsattributedstring/documenttype/wordml.md)

### Initializers

- [init(_:)](foundation/nsattributedstring/documenttype/init(_:).md)
- [init(rawValue:)](foundation/nsattributedstring/documenttype/init(rawvalue:).md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Getting document-wide attributes

- [NSAttributedString.DocumentAttributeKey](foundation/nsattributedstring/documentattributekey.md)
- [NSAttributedString.DocumentReadingOptionKey](foundation/nsattributedstring/documentreadingoptionkey.md)
- [HTML attributes](foundation/html-attributes.md)
- [NSAttributedString.TextLayoutSectionKey](foundation/nsattributedstring/textlayoutsectionkey.md)
- [NSTextScalingType](uikit/nstextscalingtype.md)
