Sets a user-defined attribute for a member.
Syntax
ESS_FUNC_M EssOtlSetUserAttribute (hOutline, hMember, pszString);
| Parameter | Data Type | Description |
|---|---|---|
hOutline | ESS_HOUTLINE_T | Outline context handle. |
hMember | ESS_HMEMBER_T | Handle of member for which to set the user-defined attribute. |
pszString | ESS_STR_T | User-defined attribute to set. |
Notes
A caller can set any number of user-defined attributes for a member. The string passed in uniquely defines each attribute and follows the same conventions as user names. See EssOtlGetUserAttributes.
Attempting to set a user attribute for a shared member generates an error.
Return Value
Returns 0 if successful; otherwise one of the following:
OTLAPI_BAD_USERATTR
OTLAPI_ERR_SHAREUDA
Example
#include <essapi.h>
#include <essotl.h>
ESS_STS_T sts = 0;
ESS_HOUTLINE_T hOutline;
ESS_OBJDEF_T Object;
ESS_APPNAME_T szAppName;
ESS_DBNAME_T szDbName;
ESS_OBJNAME_T szFileName;
ESS_HMEMBER_T hMember;
ESS_STR_T AttributeList;
memset(&Object, '\0', sizeof(Object));
Object.hCtx = hCtx;
Object.ObjType = ESS_OBJTYPE_OUTLINE;
strcpy(szAppName, "Sample");
strcpy(szDbName, "Basic");
strcpy(szFileName, "Basic");
Object.AppName = szAppName;
Object.DbName = szDbName;
Object.FileName = szFileName;
sts = EssOtlOpenOutline(hCtx, &Object, ESS_TRUE,
ESS_TRUE, &hOutline);
/*********** Set User Attributes ************/
AttributeList = "Read Write";
if (!sts)
{
sts = EssOtlFindMember(hOutline, "Jan",
&hMember);
}
if (!sts && hMember)
{
sts = EssOtlSetUserAttribute(hOutline, hMember,
AttributeList);
}See Also