Export (0) Print
Expand All

IOpenServiceActivityInput::GetVariable Method

Retrieves the value of the specified variable.

Syntax


HRESULT GetVariable(
    LPCWSTR pwzVariableName,
    LPCWSTR pwzVariableType,
    BSTR *pbstrVariableContent
);

Parameters

pwzVariableName
[in]  One of the following case-sensitive named variables.
documentTitle
The title of the document, if available.
documentUrl
The href of the document.
documentDomain
The domain name (including top-level domain) from the document’s URL.
documentHost
The fully qualified domain from the document’s URL.
selection
Currently selected text.
link
The href of the selected link.
linkText
The innerText of the selected link.
linkRel
The rel of the selected link.
linkType
The type of the selected link.
linkDomain
The domain name (including top-level domain) from the target URL.
linkHost
The fully qualified domain from the target URL.
pwzVariableType
[in]  One of the following variable types, or NULL to accept the default type.
text
Default. The value is represented as plain text.
html
The value is represented as HTML. This variable type is supported only by variables having the value selection or linkText.
pbstrVariableContent
[out]  The value of the variable.

Return Value

Returns one of the following values.

S_OK The operation completed successfully.
S_OK The operation completed successfully.
E_FAIL The operation failed.
E_FAIL The operation failed.
E_INVALIDARG The variable is undefined.

Remarks

Use GetType to determine the input context. Document variables are available for all three content types, but selection and link variables are available only when the input context is ActivityContentSelection and ActivityContentLink, respectively.

Note  The Accelerator platform requests the documentUrl variable for all calls to CanExecute, Execute, CanPreview, and Preview. The variable is checked against the value of homepageUrl specified by the Accelerator XML.

See Also

IOpenServiceActivityInput::HasVariable

Community Additions

ADD
Show:
© 2014 Microsoft