Share via


AppConfig.GetCountryCodeFromCountryName

Ee796796.c++_on(en-US,CS.10).gifEe796796.vb_off(en-US,CS.10).gif

Use this method to get the country/region code corresponding to the specified country/region name.

Definition

Function GetCountryCodeFromCountryName(bstrCountryName As String) As String

Parameters

bstrCountryName

A String that contains the name of the country/region for which the country/region code is being requested.

Return Values

If this method completes successfully, it returns a String that contains the country/region code. If the country/region code is not found, an empty string is returned.

Error Values

This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to standard COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

Remarks

If the country/region code is not found, the method returns an empty string.

Country/region codes and country/region names may be set in Commerce Server Business Desk.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

Example

' oAppConfig is a Commerce.AppConfig object
' sCode is a String
sCode = oAppConfig.GetCountryCodeFromCountryName("United States of _
America") 

See Also

AppConfig Object

AppConfig.GetCountryNameFromCountryCode

AppConfig.GetCountryNamesList

Table of Country/Region Names and Codes


All rights reserved.