AddAssociatedFileFromString
Associated files, attachments, memory input
Description
Embeds the binary bytes in Source and registers one reusable document-level associated file
Syntax
Delphi
Function AddAssociatedFileFromString(Const Source: AnsiString; Const DisplayName, MIMEType, Description, Relationship: WideString): Integer;DLL
int DLAddAssociatedFileFromString(int InstanceID, const char* Source, int SourceLength, const wchar_t* DisplayName, const wchar_t* MIMEType, const wchar_t* Description, const wchar_t* Relationship);
int DLAddAssociatedFileFromStringA(int InstanceID, const char* Source, int SourceLength, const char* DisplayName, const char* MIMEType, const char* Description, const char* Relationship);Parameters
| Source | Binary bytes to embed; must not be empty, and the DLL overload takes an explicit length so zero bytes are preserved |
|---|---|
| DisplayName | Name shown for the embedded file; must not be empty and must not duplicate an existing embedded-file title |
| MIMEType | MIME type stored in the file specification; must not be empty |
| Description | Optional description stored in the associated-file entry; may be empty |
| Relationship | Relationship role, one of Source, Data, Alternative, Supplement or Unspecified |
Return values
Returns a nonzero embedded-file handle on success or 0 on failure
Remarks
The DLL length parameter preserves zero bytes and must be greater than zero
Use AddAssociatedFileFromVariant for ActiveX byte arrays