TranslateAddress with non-default Location



Hello everybody,

Does anyone know how one can use the TranslateAddress to return a
DisplayableString based upon the dialing rules set in one of the locations
(NOT the default one) in the "My Locations" tab in the Phone & Modem Options
control panel?

The reason we need this is because the function is called from ASP.NET pages
which serve (a limited group of) people around the world. It is neccessary to
display phone numbers to the users in a familiar format.

We think it might be a good idea to make a few "Locations", one for each
city where our people are located and in this way the server could serve up
the pages with formatted phone numbers.

There might also be an option of having ASP.NET running clientside script to
retrieve the DisplayableString from the client machine, but the current
proposal has some benefits:
a) no security issues of accesssing clientside settings
b) some users might not have set their modem options correctly
c) some users might not even be using windows
d) unsure, but it might be impossible if client pc has no modem. and not all
pcs have modems.

Even so, if someone knows how to do it with clientside script, we'd
appreciate that info as well in case we do want to take that direction.

Here is the current VB.NET code which displays according to the default
locations dialing rules.

Shared Function DialString(ByVal stCanonical As String) As String
Dim oTAPI As New TAPI
oTAPI.Initialize()
Dim oAddTrans As ITAddressTranslation
oAddTrans = oTAPI.Addresses(1)
DialString = oAddTrans.TranslateAddress(stCanonical, 0,
0).DisplayableString
oAddTrans = Nothing
oTAPI.Shutdown()
oTAPI = Nothing
End Function

We tried changing the lCard Parameter to 1,2,3 etc. to no avail.

Please share your expertise
Thankfully,
Yisman
.