This topic has not yet been rated - Rate this topic

CustomXmlPrefixMappings.getNamespaceAsync method (JavaScript API for Office v1.1)

JavaScript API for Office v1.1

Asynchronously gets the namespace mapped to the specified prefix.

Last modified: February 26, 2014

customXmlPrefixMappingsObj.getNamespaceAsync(prefix [, options], callback);
prefix

Type: string

Specifies the prefix to get the namespace for. Required.

options

Type:object

Specifies the following optional parameters.

asyncContext

Type: array, Boolean, null, number, object, string, or undefined

A user-defined item of any type that is returned in the AsyncResult object without being altered. Optional.

callback

Type: object

A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. Optional.

When the function you passed to the callback parameter executes, it receives an AsyncResult object that you can access from the callback function's only parameter.

In the callback function passed to the getNamespaceAsync method, you can use the properties of the AsyncResult object to return the following information.

Property

Use to...

AsyncResult.value

Access a string that contains the namespace mapped to the specified prefix.

AsyncResult.status

Determine the success or failure of the operation.

AsyncResult.error

Access an Error object that provides error information if the operation failed.

AsyncResult.asyncContext

Access your user-defined object or value, if you passed one as the asyncContext parameter.

If no namespace is assigned to the requested prefix, the method returns an empty string ("").

App types

Task pane apps

Supported clients

Word 2013, Word 2013 SP1

Library

Office.js

Namespace

Office

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.