Instance Method

docFormatFromRange:documentAttributes:

Returns a data object that contains a Microsoft Word–format stream corresponding to the characters and attributes within the specified range.

Declaration

- (NSData *)docFormatFromRange:(NSRange)range documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> *)dict;

Parameters

range

The range.

docAttributes

A required dictionary specifying the document attributes. The dictionary contains values from Document Types and must at least contain NSDocumentTypeDocumentAttribute.

Return Value

Returns a data object containing the attributed string as a Microsoft Word doc file.

Discussion

Raises an NSRangeException if any part of range lies beyond the end of the receiver’s characters.

See Also

Generating Data

- dataFromRange:documentAttributes:error:

Returns an data object that contains a text stream corresponding to the characters and attributes within the given range.

- fileWrapperFromRange:documentAttributes:error:

Returns an NSFileWrapper object that contains a text stream corresponding to the characters and attributes within the given range.

- RTFFromRange:documentAttributes:

Returns an NSData object that contains an RTF stream corresponding to the characters and attributes within the given range, omitting all attachment attributes.

- RTFDFromRange:documentAttributes:

Returns a data object that contains an RTFD stream corresponding to the characters and attributes within the range.

- RTFDFileWrapperFromRange:documentAttributes:

Returns an NSFileWrapper object that contains an RTFD document corresponding to the characters and attributes within the given range.