AquaLogic Interaction Development Kit (IDK) 6.0.0 |

# IDocFetchProvider.AttachToDocument Method

Performs access-control checking on the document to be retrieved using either the user's current preferences or the information set in the portal Data Source editor. If read access is allowed, returns the `IDocFetch` object used to retrieve the document.

IDocFetch AttachToDocument(
string sDocumentLocation,
string Locale,
string Signature,
DocumentFormat fFormat,
UserPrefs userPrefs,
UserInfo userInfo
);

#### Parameters

sDocumentLocation
  The backend-specific location of this document.
Locale
  The string code for the locale to be used.
Signature
  The signature of the document.
fFormat
  The `DocumentFormat` flag to indicate whether the document is being accessed for indexing or retrieval (click-through).
userPrefs
  The requesting user's User Preference settings.
userInfo
  The requesting user's User Information settings.

#### Return Value

An instance of the implementation of `IDocFetch`.

#### Exceptions

Exception Type | Condition
--- | ---
NoLongerExistsException | The document has been removed.
NotAvailableException | The document is temporarily unavailable.
NotInitializedException | The `IDocFetchProvider` is in an uninitialized state.
AccessDeniedException | Access to this document is denied.

#### See Also

IDocFetchProvider Interface | Plumtree.Remote.Docfetch Namespace