GetVariable method

Retrieves the value of the specified variable.

 

Syntax

HRESULT retVal = object.GetVariable(pwzVariableName, pwzVariableType, pbstrVariableContent);

Parameters

pwzVariableName [in]

Type: LPCWSTR

One of the following case-sensitive named variables.

documentTitle

The IHTMLDocument2::title of the document, if available.

documentUrl

The IHTMLLocation::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 IHTMLAnchorElement::href of the selected link.

linkText

The IHTMLElement::innerText of the selected link.

linkRel

The IHTMLAnchorElement::rel of the selected link.

linkType

The IHTMLAnchorElement2::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]

Type: LPCWSTR

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]

Type: BSTR

The value of the variable.

Return value

Type: HRESULT

This method can return one of these values.

Return code Description

The variable is unavailable.

E_INVALIDARG

The variable is undefined.

 

Remarks

Use IOpenServiceActivityInput::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 IOpenServiceActivity::CanExecute, IOpenServiceActivity::Execute, IOpenServiceActivity::CanPreview, and IOpenServiceActivity::Preview. The variable is checked against the value of homepageUrl specified by the Accelerator XML.

 

See also

IOpenServiceActivityInput::HasVariable